DateToString
Alias:DateToString
, DateNow
, ConvertDateToString
, FormatDate
Output:StringStream
Converts a date to the specified format, yyyy/MM/dd HH:mm:ss by default. If no date is specified, uses the current date and time.
Parameter | Type | Required | Position | Default Value | Example | Summary |
---|---|---|---|---|---|---|
Date | dateTime | 1 | DateTime.Now | The date and time to convert to the specified format. | ||
Format As | string | 2 | yyyy/MM/dd HH:mm:ss | O | The output format to use for the date. |
Examples​
Example 1​
SCL​
DateToString 1990-01-06T09:15:00
Expected Output​
1990/01/06 09:15:00
Example 2​
SCL​
DateToString 1990-01-06T09:15:00 'yyyy/MM/dd'
Expected Output​
1990/01/06
Example 3​
SCL​
FormatDate 2022-01-01T01:01:01 As: 'HH:mm:ss'
Expected Output​
01:01:01