DATE TIME to STRING Conversion

The classes TIME, DATE, and DATE_TIME provide a query formatted_out which can be used to retrieve a string containing the date or time in a format specified by a string or format conversion codes that the caller provides as an argument. The conversion is done in the DATE_TIME_CODE_STRING class. So for example, if a DATE instance referenced by my_date has a value of February 3, 2008, then applying the query: my_date.formatted_out ("[0]dd mmm yyyy") will return the string: 03 FEB 2008

The following table lists format conversion codes.

Code Description
dd day - numeric
[0]dd day - numeric (padded with '0' to 2 figures)
ddd day - text (3 letters e.g "MON", "TUE")
yyyy year - numeric (4 figures)
yy year - numeric (2 figures)
mm month - numeric
[0]mm month - numeric (padded with '0' to 2 figures)
mmm month - text (3 letters e.g "DEC", "JAN")
hh hour - numeric (24 hour clock scale by default)
[0]hh hour - numeric (padded with '0' to 2 figures)
hh12 hour - numeric (12 hour clock scale)
mi minute - numeric
[0]mi minute - numeric (padded with '0' to 2 figures)
ss seconds - numeric
[0]ss seconds - numeric (padded with '0' to 2 figures)
ff<n> fractional seconds - numeric (precise to <n> figures)
am meridiem indicator. Includes "AM" for ante meridiem times (before noon) and "PM" for post meridiem times (after noon).
':', '/', '-' and ', separators e.g. "03/FEB/08"
These are some examples of output with their associated format code:
Code Output
yy/mm/dd 08/2/3
mmm-[0]dd-yy FEB-03-08
dd,mm,yyyy 3,2,2008
hh-mi-ss 13-6-32
hh12,mi,ss 1,6,32
hh12:[0]mi:[0]ss:ff2 am 1:06:32.25 PM
[0]hh:[0]mi:[0]ss.ff3 13:06:32.248
[0]mm/dd/yy hh12:mi:ss.ff3 02/3/08 1:6:32.248

cached: 09/23/2017 1:53:29.000 AM