Sign in Join
FPDoc Onlineexperiment

GetLocalTimeOffset function

In unit sysutils

Return local timezone offset.

Declaration

pascal
function GetLocalTimeOffset: Integer

Description

GetLocalTimeOffset returns the local timezone offset in minutes. This is the difference between UTC time and local time:

UTC = LocalTime + GetLocalTimeOffset

The TDateTime-overloads return the offset at the specified DateTime. In case the TDateTime-aware function is not supported on the current platform, False is returned or it falls back to the offset to current time (depending on the overload used).

Note that on Linux/Unix, the information returned from the TDateTime-unaware function may be inaccurate around the DST time changes (for optimization). In that case, the unix.ReReadLocalTime unit must be used to re-initialize the timezone information.

The TDateTime-aware overloads are supported currently only on Windows Vista and newer.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.