standalone library

TimeZone initialization for standalone environments.

import 'package:pg_timezone/standalone.dart';

initializeTimeZone().then((_) {
 final detroit = getLocation('America/Detroit');
 final now = TZDateTime.now(detroit);
});

Classes

Location
A Location maps time instants to the zone in use at that time. Typically, the Location represents the collection of time offsets in use in a geographical area, such as CEST and CET for central Europe.
TimeZone
A TimeZone represents a single time zone such as CEST or CET.
TZDateTime
TimeZone aware DateTime.

Properties

timeZoneDatabase LocationDatabase
Global TimeZone database
no setter
tzDataDefaultPath String
final

Functions

getLocation(String locationName) Location
Find Location by its name.
initializeTimeZone([String? path]) Future<void>
Initialize Time Zone database.
setLocalLocation(Location location) → void
Set local Location