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

ISO8601ToDate

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

Declaration

Source position: dateutil.inc line 480

function ISO8601ToDate(

  const DateString: string;

  ReturnUTC: Boolean = True

):TDateTime;

Arguments

DateString

  

ISO 8601-formatted date/time value examined in the function.

ReturnUTC

  

Indicates if the return value should be adjusted to the UTC time zone.

Function result

TDateTime value for DateString.

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

TryISO8601ToDate

  

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

DateToISO8601

  

Converts a TDateTime value to ISO 8601 date/time format.


Documentation generated on: Oct 27 2024