ISO8601ToDate

Converts a date/time value in ISO 8601 notation to a native TDateTime type

Declaration

Source position: dateutil.inc line 456

  function ISO8601ToDate(const DateString: string; ReturnUTC: Boolean)
                         : TDateTime;

Description

ISO8601ToDate is a function used to convert a string using ISO 8601 date/time notation to a native TDateTime type.

DateString contains the date/time value expressed using ISO 8601 notation.

ReturnUTC indicates if the TDateTime value should be adjusted to reflect the UTC (Coordinated Universal Time) time zone. The default value for the argument is True.

ISO8601ToDate calls the TryISO8601ToDate function to perform the conversion, and raises an EConvertError exception if DateString contains an invalid ISO 8601 date/time value. The return value contains the native TDateTime value for the timestamp (adjusted to UTC when requested).

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

See also

Name Description
DateToISO8601 Converts a TDateTime value to ISO 8601 date/time format
TryISO8601ToDate Attempts to convert an ISO 8601-formatted date/time value to a TDateTime type