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

Un-parseable date #405

Open
CromonMS opened this issue Jun 11, 2021 · 3 comments
Open

Un-parseable date #405

CromonMS opened this issue Jun 11, 2021 · 3 comments

Comments

@CromonMS
Copy link

This Date String does not seem to parse, but the day after it does:

2.7.2 (main):0 > Chronic.parse('3/28/21 12:25am', endian_precedence: :little)&.end_of_month                   
=> nil
2.7.2 (main):0 > Chronic.parse('3/29/21 12:25am', endian_precedence: :little)&.end_of_month                   
=> 2021-03-31 23:59:59.999999999 +0100

Not sure why the first one isn't working, any ideas?

Thanks.

@joevandyk
Copy link

works for me? on OSX

irb(main):001:0> Chronic.parse('3/28/21 12:25am', endian_precedence: :little)&.end_of_month
=> Wed, 31 Mar 2021 23:59:59 PDT -07:00

irb(main):002:0> Chronic::VERSION
=> "0.10.2"

@CromonMS
Copy link
Author

That's strange doesn't work on my VM (that's current version - but has never worked since the first post):
Linux ubuntu 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

but does work in production on:
Linux ubuntu 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

same version 0.10.2, what a strange quirk, must be a conflict with something on my VM..

@viamin
Copy link

viamin commented Mar 13, 2023

I'm seeing something similar, and I'm guessing that it has something to do with time changes:

Chronic.parse("2023-03-12 12:15am")
=> nil
Chronic.parse("2023-03-12 1:15am")
=> 2023-03-12 00:15:00 -0800.  <= NOTE off by 1 hour
Time.parse("2023-03-12 1:15am")
=> 2023-03-12 01:15:00 -0800 <= Time.parse works fine
Chronic.parse("2023-03-12 3:15am")
=> 2023-03-12 03:15:00 -0700

Daylight savings time started on 2023-03-12 - Chronic seems to be treating the entire day as PDT, when PDT actually starts at 2:00am.

viamin added a commit to viamin/task_bridge that referenced this issue Mar 13, 2023
viamin added a commit to viamin/task_bridge that referenced this issue Mar 14, 2023
* Extract base class from services

* Pulled out some shared code from services and sync_items

* Moving more shared code into the base classes

* Work around Chronic bug due to time change
(mojombo/chronic#405)

* Fix github sync issue

* Don't use a default min_service_interval

* Better naming
also alphabetize top level requires

* Get specs passing locally
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

3 participants