Unit 'DateUtils' Package
[Overview][Constants][Classes][Procedures and functions][Index] [#rtl]

TryISOTZStrToTZOffset

Attempts to convert an ISO 8601 time zone designation to an offset in minutes.

Declaration

Source position: dateutil.inc line 475

function TryISOTZStrToTZOffset(

  const TZ: string;

  out TZOffset: Integer

):Boolean;

Arguments

TZ

  

time zone designation examined in the method.

TZOffset

  

Contains the time zone offset expressed as a positive or negative number of minutes.

Function result

True if the time zone designation was converted to an offset.

Description

TryISOTZStrToTZOffset is a Boolean function which attempts to convert the ISO 8601 time zone designation to a time zone offset expressed as a positive or negative number of minutes. TZ contains the time zone designation examined in the function. It should not contain any other portion of a date/time value using ISO 8601 notation - just the time zone designation.

TryISOTZStrToTZOffset recognizes the following values in the TZ argument:

Z
Represents time zone Zulu (short for "Zulu time") as used by the military and in navigation. Refers to UTC (Coordinated Universal Time), formerly known as Greenwich Mean Time.
±HHNN or ±HH:NN
time zone designation expressed as a positive or negative number of hours and minutes for a given time value.

TZOffset is an Integer updated to contains the number of minutes needed to adjust a time value for a given time zone back to UTC (Zulu time). The hour and minute component values in TZ are converted to minutes and complemented (multiplied by -1) to derive the offset value. The derived value in TZOffset is 0 when TZ contains Zulu time, an empty string (''), or cannot be converted successfully.

The return value is True if the time zone designation in TZ is successfully converted to a time zone offset.

Use ISOTZStrToTZOffset to convert the time zone designation and raise an exception for an invalid time zone designation.

See also

ISOTZStrToTZOffset


Documentation generated on: Nov 23 2024