Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix strftime implementations for format strings "%F" and "%j" #475

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

markusmarchewa
Copy link

Description

1.) "%F" is supposed to be same as "%Y-%m-%d" (https://www.php.net/manual/en/function.strftime.php) but was "%y-…"

2.) "%j" (day of the year) was wrong in locales with DST shifts because the interval between the start of a day during DST and the start of the year might be less than a multiple of 24 hours (the day when DST starts has just 23 hours and the day when it ends has 25 hours). Compensate by talking the timezone offsets into calculation. The test changes process.env.TZ temporarily.

Checklist

Yes,

  • I have checked to ensure there aren't other open Pull Requests for
    the same update/change?
  • I have followed the guidelines in our
    Contributing and e.g. bundled a test in the
    function header comments that fails before this PR, but passes after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant