Date.format

Date.format

Date.format

Function

Output date and time in chrono/strftime style format string.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
patternStringNo%Y-%m-%d %H:%M:%SFormat string.

Return value

TypeDescription
StringReturns the formatted date string.

Code Example

Notes

  • Format characters use chrono/strftime style, such as %Y-%m-%d %H:%M:%S, %F %T.
  • When pattern is not passed, %Y-%m-%d %H:%M:%S format is returned.