srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
102 stars 53 forks source link

time zone doesn't exist #117

Closed MurtuzaSrashtaSoft closed 2 years ago

MurtuzaSrashtaSoft commented 2 years ago

Pub version : timezone: ^0.5.6

We are receiving the below error while applying the below the region in the below code

Europe/Nicosia Europe/Tiraspol Europe/Belfast

import 'package:timezone/data/latest.dart' as tz;
import 'package:timezone/timezone.dart' as tz;

  DateTime getDateTime() {
    tz.initializeTimeZones();
    final detroit = tz.getLocation("Europe/Belfast");
    final DateTime dateTime = tz.TZDateTime.now(detroit);
    return dateTime;
  } 

Untitled

srawlins commented 2 years ago

As these time zones are deprecated, they are not available in the default data base (e.g. latest.dart); they are available in the "all" variant (e.g. latest_all.dart).