PgTimeZone
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Resolves PostgreSQL timezone names and abbreviations using the backend’s timezone database.
public static class PgTimeZoneInheritance: object
Methods
Section titled “Methods”GetOffset(string)
Section titled “GetOffset(string)”Gets the offset east of UTC for a named zone at the current transaction’s start instant.
public static TimeSpan GetOffset(string zone)Parameters:
zone — string
A PostgreSQL timezone name, abbreviation, or POSIX timezone specification.
Returns: TimeSpan
The offset, including historical seconds where applicable.
Requires the active backend thread. Fixed abbreviations retain their fixed offsets; dynamic abbreviations and full zone names resolve at transaction start.
GetOffset(string, PgTimestampTz)
Section titled “GetOffset(string, PgTimestampTz)”Gets the offset east of UTC for a named zone at a particular finite instant.
public static TimeSpan GetOffset(string zone, PgTimestampTz instant)Parameters:
zone — string
A PostgreSQL timezone name, abbreviation, or POSIX timezone specification.
instant — PgTimestampTz
The instant at which to resolve historical and daylight-saving rules.
Returns: TimeSpan
The offset, including historical seconds where applicable.
Exceptions:
- ArgumentOutOfRangeException: The instant is infinite.
Requires the active backend thread and leaves the session timezone unchanged. PostgreSQL’s native timezone routines determine behavior across its complete timestamp range.