sisyphsu / dateparser

dateparser is a smart and high-performance date parser library, it supports hundreds of different formats, nearly all format that we may used. And this is also a showcase for "retree" algorithm.
MIT License
95 stars 23 forks source link

Fixed DST problem for dates with time zone indicator #22

Closed andriy-samson closed 2 years ago

andriy-samson commented 2 years ago

Problem: when date with time zone indicator is parsed by DateBuilder.parseDate(String) the local DST (Daylight saving time) affects the parsed result by DST offset of local JVM. The expected behaviour is: when parsed date has a time zone indication then the parsed date must respect only time zone offset of parsed date. The TimeZone of locale JVM must not affect the parsed result.

(DateBuilder.java)

(DateParserTest.java)

P.S. It is expected that this fix solves the issue #8(Strange timezone offsets)

sisyphsu commented 2 years ago

Thanks for your PR