[Overview][Constants][Procedures and functions][Index] Reference for unit 'DateUtils' (#rtl)

UniversalTimeToLocal

Convert UTC time to local time

Declaration

Source position: dateutil.inc line 433

function UniversalTimeToLocal(

  UT: TDateTime

):TDateTime;

function UniversalTimeToLocal(

  UT: TDateTime;

  TZOffset: Integer

):TDateTime;

Description

UniversalTimeToLocal converts a universal time indication to a local time: it applies the TZOffset time zone offset to the UT Universal time (UTC). If no TZOffset is specified, the local time offset as returned by GetLocalTimeOffset is used.

Note that for times in the past or in the future, or for time zones with DST, omitting the TZoffset may lead to wrong results, as the current time zone offset is used. Calculation of the correct time zone offset for a given date is very complicated, and outside the scope of this call.

See also

GetLocalTimeOffset

LocalTimeToUniversal

  

Convert local time to UTC time


Documentation generated on: Jun 22 2020