USFormat.DateToChar

Previous Next

Converts a date value to a string.

Returns the result of the conversion as a string.

Syntax

SELECT USFormat.DateToChar(
         date
,        date-format-pattern
)

Both date and date-format-pattern are required. Date-format-pattern must be one of the USoft IO formats for date values.

 

Example

SELECT USFormat.DateToChar(
         current_date()
,        'DD-MM-YYYY'
)

On March 28, 2019, the return value of this statement is the string:

28-03-2019