browser library

TimeZone initialization for browser environments.

import 'package:timezone/browser.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.

Constants

tzDataDefaultPath → const String
Path to the Time Zone default database.

Properties

timeZoneDatabase LocationDatabase
Global TimeZone database
no setter

Functions

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