Skip to content

TryISO8601ToDate

Attempts to convert an ISO 8601-formatted date/time value to a TDateTime type

Declaration

Source position: dateutil.inc line 459

  function TryISO8601ToDate(const DateString: string; 
                           out ADateTime: TDateTime; ReturnUTC: Boolean)
                            : Boolean;

Description

TryISO8601ToDate is a Boolean function which attempts to convert an ISO 8601-formatted date/time value to a TDateTime type.

DateString contains the ISO 8601 date/time value converted in the function. DateString must contain one of the supported ISO 8601 date/time notations supported in the routine. It is separated into date, time, and time zone values, and is converted by calling both the TryISOStrToDateTime and TryISOTZStrToTZOffset functions. See TryISOStrToDateTime for more information about supported ISO 8601 notations.

ReturnUTC indicates if the native date/time value needs to be adjusted to the UTC (Coordinated Universal Time) time zone. The default value for the argument is True, and causes GetLocalTimeOffset to be called to get and apply the time zone offset for the local computer.

ADateTime contains the native TDateTime value for the converted timestamp adjusted to the UTC time zone when ReturnUTC contains True.

Use DateToISO8601 to convert a native date/time value back to its representation in ISO 8601 notation.

See also

Name Description
DateToISO8601 Converts a TDateTime value to ISO 8601 date/time format