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

Placing the year after time causes parsing to change the year #208

Open
michael-bryson opened this issue Jan 4, 2017 · 0 comments
Open

Comments

@michael-bryson
Copy link

I am seeing issue with some dates which have the time before the year. For example:

  • "Mon Feb 29 08:37:00 2016" is parsed as "Mon Mar 01 08:37:00 UTC 2010"
  • "Thu Jan 1 00:00:00 1970" is parsed as "Thu Jan 01 00:00:00 UTC 2015"

As you can see the year gets changed and in the case of Feb 29 the year is changed to a non-leap year (2010) so the day moves to 1st March.

If I change the order and place the year before the time then the date is parsed correctly, for example:

  • "Mon Feb 29 2016 08:37:00"
  • "Thu Jan 1 1970 00:00:00"

However this pattern does not always cause the parsing to fail as a date such as "Fri Apr 22 10:54:33 2016" is parsed correctly.

This is a required date format for us as we use this to parse dates coming from emails which are returned in this format.

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

No branches or pull requests

1 participant