Open rafaellop opened 1 year ago
Additional info:
The timezone is initialized like this:
tz.initializeTimeZones();
but if I add additional initialization code:
final String timeZoneName = await FlutterNativeTimezone.getLocalTimezone();
tz.setLocalLocation(tz.getLocation(timeZoneName));
Then both dates in the above example are the same, but not properly 1 hour shifted. I mean the first date is assigned to the now
variable is not 2022-11-21 10:59
and the second remains the same 2022-11-21 10:00
. In the effect if I use these datetimes in a local notification setup it is fired an hour later than expected.
The hour is incorrectly timezoned if a date is instantiated by
now(
) or by a value. For example I have this function:The
now
variable is correctly set according to my timezone while it seems that the second variable calledscheduledDate
doesn't consider the tz.local at all. Example with some numbers:For the local time of e.g.
2022-11-21 10:59
thenow
variable is set to2022-11-21 9:59
However thescheduledDate
with thehour
parameter set to e.g.11
is just left as2022-11-21 11:00
when it should be2022-11-21 10:00
.I'm on GMT+01:00.