StrToDateTime
Qubes 5.6 Converts a string to a date/time in a user-defined format.
Syntax
StrToDateTime(format, string)
format = string specifying the format to use (see below)
string = string you want to convert to a date
string = string you want to convert to a date
Remarks
StrToDateTime is the inverse function of FormatDateTime.
format must correspond to the format of the string, otherwise the function will return "#VAL!".
The format string can contain the following specifiers:
| Specifier | Display |
| d | Displays the day number without a zero prefix (from 1 to 31). |
| dd | Displays the day number with a zero prefix (from 01 to 31). |
| ddd | Displays the abbreviated day (Sun to Sat). |
| dddd | Displays the whole day (Sunday to Saturday). |
| m | Displays the month number without a zero prefix (from 1 to 12). |
| mm | Displays the month number with a zero prefix (from 01 to 12). |
| mmm | Displays the abbreviated month (Jan to Dec). |
| mmmm | Displays the whole month (January to December). |
| yy | Displays the two-digit year number (00 to 99). |
| yyyy | Displays the four-digit year number (0000-9999). |
| h | Displays the hour on the 24-hour clock without a zero prefix (0 to 23). |
| hh | Displays the hour on the 24-hour clock with a zero prefix (00 to 23). |
| n | Displays the minutes without a zero prefix (0 to 59). |
| nn | Displays the minutes with a zero prefix (00 to 59). |
| s | Displays the seconds without a zero prefix (0 to 59). |
| ss | Displays the seconds with a zero prefix (00 to 59). |
| z | Displays the milliseconds without a zero prefix (0 to 999). |
| zzz | Displays the milliseconds with a zero prefix (000 to 999). |
Examples
StrToDateTime('yyyy-mm-dd','2011-08-19')=August 19, 2011StrToDateTime('hh:nn:ss dd.mm.yy','14:36:59 19.08.11')=August 19, 2011 14:36:59
ISO8601 string to DateTime:StrToDateTime("yyyy-mm-ddThh:nn:ss","2025-08-18T10:42:20Z")=August 18, 2025 10:42:20