Closed Pante closed 3 months ago
The following code snippet on master:
master
import 'package:timezone/data/latest.dart' as tz; void main() { tz.initializeTimeZones(); final location = getLocation('America/Detroit'); final datetime = TZDateTime(location, 2023, 3, 12, 2); print('local: ${datetime.toIso8601String()}'); print(datetime.millisecondsSinceEpoch); }
Produces the following:
local: 2022-03-13T01:00:00.000-0500 1647151200000
This is incorrect since the time should 3am instead of 1am due to DST, https://www.timeanddate.com/time/change/usa/detroit?year=2023.
From a brief look it's probably related to how the timezone is derived in https://github.com/srawlins/timezone/blob/master/lib/src/date_time.dart#L22.
The following code snippet on
master
:Produces the following:
This is incorrect since the time should 3am instead of 1am due to DST, https://www.timeanddate.com/time/change/usa/detroit?year=2023.
From a brief look it's probably related to how the timezone is derived in https://github.com/srawlins/timezone/blob/master/lib/src/date_time.dart#L22.