Unit 'sysutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]


Return local timezone offset.


Source position: datih.inc line 206

function GetLocalTimeOffset: Integer;

function GetLocalTimeOffset(

  const DateTime: TDateTime;

  const InputIsUTC: Boolean;

  out Offset: Integer


function GetLocalTimeOffset(

  const DateTime: TDateTime;

  const InputIsUTC: Boolean = False



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



Re-Read the local time files.



Return the current date.



Returns the current time.



Returns the current date and time.

Documentation generated on: Jul 24 2023