srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
101 stars 52 forks source link

Feature request: When parsing a timestamp, set the time zone to the one given in the timestamp #182

Open schaerfo opened 8 months ago

schaerfo commented 8 months ago

E. g., the timestamp 2023-10-27T22:14:00+02:00 should be parsed with the time zone of the resulting TZDateTime object being set to UTC+2. This could likely be implemented as a new static method of TZDateTime that differs from the existing parse method in that it only takes a single argument (the timestamp as String).

This would probably require the introduction of "unnamed" time zones that consist only in an offset from UTC.