Appearance
UTCToLocal
Declaration
Function UTCToLocal(const AValue: TDateTime): TDateTime
Example
pascal
procedure OnMapEvent(var Value:Variant); //ORDER_DATE_LOCAL
begin
// if function is called with 2017-06-25 02:15:16 (i.e. 2:15 am UTC), during NZ Standard Time, then result is 2017-06-25 14:15:16 (i.e. 2:15 p.m. local)
// if function is called with 2017-12-25 02:15:16 (i.e. 2:15 am UTC), during NZ Daylight Time, then result is 2017-12-25 15:15:16 (i.e. 3:15 p.m. local)
Value := UTCToLocal(ORDERS['ORDER_DATE_UTC'].Value);
end;Description
Returns the date and time value in local time that corresponds to the given date and time (AValue) in UTC (Universal Coordinated Time).
UTC/Universal Coordinated Time is the base time and time-zone from which the other time-zones around the world are defined and calculated. For almost all practical purposes, UTC is equivalent to the older term "Greenwich Mean Time (GMT)".
UTC never has "Daylight Time" applied to it, whereas local time-zones can have alternating periods of "Standard Time" and "Daylight (Saving) Time". This function will use the time-zone setting from the Windows operating system on the Flow server, at the time that the function is called. This function is not intended to be used for date calculations away from the current local time, because it will not adjust for any changes in time-zone settings that have occurred during the intervening period.
For example, when New Zealand Standard Time applies (i.e. NZ winter time, more or less) the function will return a local time that is 12 hours ahead, but when New Zealand Daylight Time applies (i.e. NZ summer time, more or less) the function will return a local time that is 13 hours ahead.