TryISOStrToDate

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

Declaration

Source position: dateutil.inc line 445

  function TryISOStrToDate(const aString: string; out outDate: TDateTime)
                           : Boolean;

Description

TryISOStrToDate is a Boolean function which attempts to convert an ISO 8601-formatted date value in aString to a TDateTime type. The return value is True if the string is successfully converted into a native date value.

aString contains the date value converted in the function, and can use one of the following ISO 8601 notations :

YYYYMMDD YYYY-MM-DD

outDate is an output parameter where the converted TDateTime value is stored in the function. The return value is False (and outDate is set to an empty date value) if aString cannot be converted in the routine.The time portion of the TDateTime value is not used or updated in the function.

Use TryISOStrToTime to convert a time value to a native TDateTime type.

Use TryISOStrToDateTime to convert a string which contains both date and time values to a TDateTime type.

See also

Name Description
TryISOStrToDateTime Attempts to convert an ISO 8601-formatted date/time value to a TDateTime type
TryISOStrToTime Converts an ISO 8601-formatted time value to a TDateTime type