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

fails to parse "03/10/2013 12:00 AM" #228

Open
anazar opened this issue Nov 12, 2013 · 7 comments
Open

fails to parse "03/10/2013 12:00 AM" #228

anazar opened this issue Nov 12, 2013 · 7 comments
Labels

Comments

@anazar
Copy link

anazar commented Nov 12, 2013

Chronic.parse("03/10/2013 12:00 AM")

Returns nil

@davispuh
Copy link
Collaborator

I can't reproduce, it works fine for me. Most likly something with your timezone/environment. Could you provide more details (timezone, ruby, platform)? And try with newest Chronic 0.10.2

@anazar
Copy link
Author

anazar commented Nov 12, 2013

chronic (0.10.2)
Ruby 2.0.0
Rails 4.0.0

It's a timezone thing.

We have our timezone set as follows:

config.time_zone = 'Pacific Time (US & Canada)'

When that is removed it works fine.

@davispuh
Copy link
Collaborator

Seems same as #177 and #179 caused by DST change on that day. Currently Chronic doesn't have any real support for daylight time changes. Also related bugs: #222 #147

@direction
Copy link

Has there been any updates on this? I'm getting the following errors (all to do with DST starting)

Chronic.parse("2014-03-09")
=> Sun, 09 Mar 2014 13:00:00 EDT -04:00 # Why is this at one in the afternoon?

Chronic.parse("2014-03-09 12:00 AM")
=> nil

Chronic.parse("2014-03-09 12:59 AM")
=> nil

Chronic.parse("2014-03-09 1:00 AM")
=> Sun, 09 Mar 2014 00:00:00 EST -05:00 # Why is this midnight?

Chronic.parse("2014-03-09 2 AM")
=> Sun, 09 Mar 2014 01:00:00 EST -05:00 # This has moved back by one hour

Chronic.parse("2014-03-09 12:00 PM")
=> Mon, 10 Mar 2014 00:00:00 EDT -04:00 # Why is this midnight of the next day?

If I try any other times on that day after 2 AM that is not between noon and 1pm, the parsing is correct.

@davispuh
Copy link
Collaborator

There haven't been any updates regarding this issue, so it's not fixed.

@c-lliope
Copy link

I'm getting the same thing:

Chronic.parse "3/8/2014 11:59:59 PM"
=> 2014-03-08 23:59:59 -0500
Chronic.parse "3/9/2014 12:00:00 AM"
=> nil
Chronic.parse "3/9/2014 12:59:59 AM"
=> nil
Chronic.parse "3/9/2014 1:00:00 AM"
=> 2014-03-09 00:00:00 -0500

Time.zone.to_s
=> "(GMT-05:00) Eastern Time (US & Canada)"

Ruby version:
ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-darwin13.0]

@maricris-sn
Copy link

I'm also experiencing something similar:

Chronic.parse("3 Nov 2013 10 AM")
=> 2013-11-03 10:00:00 -0500
Chronic.parse("3 Nov 2013 11 AM")
=> nil
Time.zone.to_s
"(GMT-05:00) Eastern Time (US & Canada)"

Ruby version:
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Rails version:
3.0.19

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

No branches or pull requests

5 participants