[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

TryStrToDateTime

Try to convert a string with date/time indication to a TDateTime value

Declaration

Source position: datih.inc line 129

function TryStrToDateTime(

  const S: String;

  out Value: TDateTime

):Boolean;

Description

TryStrToDateTimetries to convert the string Sto a TDateTimedate and time value, and stores the result in Value. The date must consist of 1 to three digits, separated by the DateSeparatorcharacter. If two numbers are given, they are supposed to form the day and month of the current year. If only one number is given, it is supposed to represent the day of the current month (This is notsupported in Delphi). The time must consist of 1 to 4 digits, separated by the TimeSeparatorcharacter. If two numbers are given, they are supposed to form the hour and minutes.

The function returns Trueif the string contained a valid date and time indication, Falseotherwise.

See also

TryStrToDate

  

Try to convert a string with a date indication to a TDateTime value

TryStrToTime

  

Try to convert a string with a time indication to a TDateTime value

StrToDateTime

  

Convert a date/time string to a TDateTimevalue.

StrToTime

  

Convert a time string to a TDateTimevalue.

DateToStr

  

Converts a TDateTimevalue to a date string with a predefined format.

TimeToStr

  

Convert a TDateTimetime to a string using a predefined format.