You are viewing content for 5.1 | 5.0 | 4.9 | 4.8 | 4.7 | 4.6 | 4.5 | 4.4 | 4.3 | Previous Releases


formatDate

Returns the date as a string formatted according to specification.

Example

Format December 24, 2001 23:55:12.000 in the MMM-dd-yyyy format.

formatDate(timestamp("2001-12-24 23:55:12.000"), "MMM-dd-yyyy")

This example returns Dec-24-2001.

Syntax

formatDate(timestamp expr t, format)
  • t: expression evaluating to a timestamp type
  • format: string describing the format of the output

Returns

string

Notes

formatDate takes a timestamp and format string and returns a string corresponding to that date, in the format specified by the string.

Symbols allowed in the format string are:

  • y - year
  • M - month
  • d - day
  • m - minutes
  • s - seconds

© Incorta, Inc. All Rights Reserved.