Skip to main content
Version: v0.18.0

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.

ParameterTypeRequiredPositionDefault ValueExampleSummary
DatedateTime1DateTime.NowThe date and time to convert to the specified format.
Format
As
string2yyyy/MM/dd HH:mm:ssOThe 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