Skip to content

weekdays() is locale-sensitive, should only be used for formatting, not for calculations #3

Open
@thiloplanz

Description

@thiloplanz

The README file recommends:

For this part the weekdays() function may be of some help here.

This function returns strings that are locale-sensitive, though.

If one were to then use pattern matching to determine if a given day falls on the weekend, that code may not work on another person's machine (where the names are from a different language).

Maybe strftime (which can return a 0 - 6 number for the weekday) is a better choice, especially in a class about reproducible code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions