toString Function

Top  Previous  Next

Converts a date/time value to a string in a standard format.

Syntax

DateTime.toString(date)

Arguments

dateAn integer that is a date/time value.

Return Value

A string in the format M/d/yyyy h:mm:ss am|pm.

Remarks

If the date/time value is only a time, only the time will appear in the string. If the date/time value is only a date, only the date will appear in the string.

 

To customize formatting, use the toArray function to extract the date & time components and build a formatted string with concatenation.

Examples

DateTime.toString()