[Overview][Constants][Procedures and functions][Index] Reference for unit 'DateUtils' (#rtl)

TryISOStrToTime

Converts an ISO 8601-formatted time value to a TDateTime type

Declaration

Source position: dateutil.inc line 460

function TryISOStrToTime(

  const aString: string;

  out outTime: TDateTime

):Boolean;

Arguments

aString

  

ISO 8601 time value converted in the function

outTime

  

TDateTime type containing the time value from the function

Function result

True if the time value is successfully converted to a TDateTime type

Description

TryISOStrToTime is a Boolean function which attempts to convert the specified ISO 8601 time value to a TDateTime type. aString contains the ISO 8601 time value examined in the function, and can use one of the following notations:

aString may contain an optional time zone designation at the end of the string value, like 'Z' for Zulu time zone or a time zone offset expressed using either positive or negative hours and minutes. For example:

The return value is True if the time value in aString is successfully converted in the function.

outTime is a TDateTime type used to store the time value converted in the function. When the return value is False, outTime contains 0 for an empty time value.

Use TryISOStrToDate to convert an ISO 8601 date value to a TDateTime type.

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

See also

TryISOStrToDate

  

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

TryISOStrToDateTime

  

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


Documentation generated on: May 14 2021