From Clomosy Docs

No edit summary
No edit summary
Line 30: Line 30:
<h2> See Also </h2>
<h2> See Also </h2>
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
{{#seo:|description=StrToDate converts a date string to a TclDateTime value using the default format.}}

Revision as of 09:04, 24 December 2024

The StrToDate function attempts to convert a date as a string S into a TclDateTime value.
The default format is day.month.year, where :

The day must be 1..31 (depending on month/year)
The month must be 1..12
The year must be 0..9999 (optional)

Example

var
   myDate : TclDate;
   dateStr : String;
{
   dateStr = '28.02.2023';
   myDate = StrToDate(dateStr);
   ShowMessage('Date = '+DateTimeToStr(myDate));
}

Output:

See Also