nurse / strptime

a fast strptime engine
Other
38 stars 12 forks source link

Invalid timezone in timezone using daylight saving time #8

Closed tagomoris closed 8 years ago

tagomoris commented 8 years ago

In timezone enabled DST (e.g., March 15th 2016 in Bay Area), this gem produces time objects with wrong timezone offset for non-DST enabled date.

$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
$ ruby -rtime -e 'p Time.parse("Dec 11 00:00:00")'
2016-12-11 00:00:00 -0800
$ ruby -rstrptime -e 'p Strptime.new("%b %d %H:%M:%S").exec("Dec 11 00:00:00")'
2016-12-11 00:00:00 -0700

In December, correct timezone offset is -0800, but that gem created an instance with -0700, which is same timezone offset of localtime (DST enabled).

$ gem list --local strptime

*** LOCAL GEMS ***

strptime (0.1.6)
tagomoris commented 8 years ago

@nurse Do you have any plan to release new version? I'll update dependency of Fluentd after that.

nurse commented 8 years ago

@tagomoris done