Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Daylight savings starting two hours late #158

Open
AndreHaueisen opened this issue Mar 4, 2023 · 0 comments
Open

[Bug] Daylight savings starting two hours late #158

AndreHaueisen opened this issue Mar 4, 2023 · 0 comments

Comments

@AndreHaueisen
Copy link

AndreHaueisen commented Mar 4, 2023

In 2023, the US daylight savings start on March 12th at 2 a.m.

Observe the time zone abbreviation in the video. It changes to CDT at 5 a.m. instead of 3 a.m. (since 2 a.m. essentially doesn't exist for the 12th).

Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-03-03.at.08.45.10.mp4

This is the code I'm using to get the abbreviation

static String? _getTimeZoneAbbreviation({
    required DateTime dateTime,
    required String? locationName,
  }) {
    if (locationName == null) return null;
    final location = tz.getLocation(locationName);
    final date = tz.TZDateTime.from(dateTime, location);
    return date.timeZone.abbreviation;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant