TimezoneService class abstract Core
Timezone service helpers.
Use the static methods on this class to resolve timezone information for a given geographic coordinate or a named IANA timezone identifier. The API exposes both asynchronous (online) methods which query a remote service for the most up-to-date information and synchronous (offline) methods that use builtin timezone data.
Notes:
- Always pass the
timeparameter as a UTC DateTime. The service computes offsets for that instant in time. - The synchronous (
*Sync) methods are faster and work without network access, but the offline timezone dataset may be outdated. When a sync lookup succeeds but uses stale data, the returned TimezoneResult.status will be TimeZoneStatus.successUsingObsoleteData.
See also:
- TimezoneResult - The result object that exposes the status and offsets.
- TimeZoneStatus - Possible status values for timezone lookups.
- ApiErrorService — retrieve the last SDK error code when a method
returns
nullor fails to start.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getTimezoneInfoFromCoordinates(
{required Coordinates coords, required DateTime time, void onComplete(GemError error, TimezoneResult? result)?}) → ProgressListener? - Asynchronously retrieves timezone information for a coordinate and an UTC timestamp.
-
getTimezoneInfoFromCoordinatesSync(
{required Coordinates coords, required DateTime time}) → TimezoneResult? - Synchronously retrieves timezone information for a coordinate and an UTC timestamp using local/offline data.
-
getTimezoneInfoFromTimezoneId(
{required String timezoneId, required DateTime time, void onComplete(GemError error, TimezoneResult? result)?}) → ProgressListener? - Asynchronously retrieves timezone information for an IANA timezone id and an UTC timestamp.
-
getTimezoneInfoTimezoneIdSync(
{required String timezoneId, required DateTime time}) → TimezoneResult? - Synchronously retrieves timezone information for an IANA timezone id and an UTC timestamp using local/offline data.