Skip to content

Eastern location to UTC conversion is wrong. #213

@safield

Description

@safield

In the following test case, hours should be 19, not 20.

test('handles UTC correctly', () {
        tz.initializeTimeZones();
        final easternLocation = tz.getLocation('America/New_York');
        final DateTime localDateTime = DateTime(2023, 12, 25, 14, 30); // Dec 25 2023 2:30PM

        final tz.TZDateTime estDateTime = tz.TZDateTime.from(localDateTime, easternLocation);

        final DateTime utcDateTime = estDateTime.toUtc();

        expect(utcDateTime.hour, equals(19)); // 14:30 EST = 19:30 UTC

        return utcDateTime;
      });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions