time_machine icon indicating copy to clipboard operation
time_machine copied to clipboard

Time zone US/Eastern is unknown to source TZDB: 2018

Open hemanthStack opened this issue 6 years ago • 4 comments

Hi, I found this library today for my requirement I have to convert entire app to timezone time example US/Eastern When I tried it says not found can help me with this error

hemanthStack avatar Dec 03 '19 11:12 hemanthStack

How to update Timezone DB

hemanthStack avatar Dec 03 '19 11:12 hemanthStack

Perhaps this will help: https://nodatime.org/1.2.x/userguide/tzdb

rodion-m avatar Feb 01 '20 16:02 rodion-m

Looking at the https://pub.dev/packages/timezone package. They explicitly add the old US timezone names:

default (doesn't contain deprecated and historical zones with some exceptions like US/Eastern). 361kb

This seems smart since iOS is still sometimes reporting the old timezone names which can not be found in time_machine. I am getting error directly from the Apple Review because US/Pacific is not found.

I have arrived at the conclusion, that I need the timezone package to translate the old US timezones or hardcode them in order to use the time_machine package. But really the legacy US timezone names need to be included time_machine.

kuhnroyal avatar Nov 04 '20 14:11 kuhnroyal

Using this atm:

      TimeMachine.initialize(<dynamic, dynamic>{
        'rootBundle': rootBundle,
        // Manually map legacy timezones reported by iOS to official IANA names
        'timeZone': (await FlutterNativeTimezone.getLocalTimezone())
            .replaceAll('GMT', 'UTC')
            .replaceAll('US/Alaska', 'America/Anchorage')
            .replaceAll('US/Arizona', 'America/Phoenix')
            .replaceAll('US/Central', 'America/Chicago')
            .replaceAll('US/Eastern', 'America/New_York')
            .replaceAll('US/Hawaii', 'Pacific/Honolulu')
            .replaceAll('US/Mountain', 'America/Denver')
            .replaceAll('US/Pacific', 'America/Los_Angeles'),
      }),

kuhnroyal avatar Nov 04 '20 15:11 kuhnroyal