[Overview][Constants][Types][Classes][Procedures and functions][Variables] |
Convert a time string to a TDateTimevalue.
Source position: datih.inc line 119
function StrToTime( |
const S: String |
):TDateTime; |
StrToTimeconverts the string Sto a TDateTimetime value. 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.
On error (e.g. an invalid date or invalid character), an EConvertErrorexception is raised.
|
Convert a date string to a TDateTimevalue. |
|
|
Convert a date/time string to a TDateTimevalue. |
|
|
Convert a TDateTimetime to a string using a predefined format. |
Program Example21; { This program demonstrates the StrToTime function } Uses sysutils; Procedure TestStr (S : String); begin Writeln (S,' : ',TimeToStr(StrToTime(S))); end; Begin teststr (TimeToStr(Time)); teststr ('12:00'); teststr ('15:30'); teststr ('3:30PM'); End.