DATE_STRING
Syntax
DATE_STRING(julian_date [, 'output_format'[, max_length]]) DATE_STRING(julian_date [, 'format_string'[, max_length]]
Parameters
julian_date
A number representing a Julian date, the number of days elapsed since January 1, 0000.
output_format
String, valid date format.
max_length
format_string
A format string optionally including any combination of the following format codes:
Code
Description
%a
Abbreviated weekday name
%A
Full weekday name
%b
Abbreviated month name
%B
Full month name
%c
Date and time representation appropriate for locale
%d
Day of month (01 - 31)
%H
Hour in 24-hour format (00 - 23)
%I
Hour in 12-hour format (01 - 12)
%j
Day of year (001 - 366)
%m
Month (01 - 12)
%M
Minute (00 - 59)
%p
Current
locale's AM/PM indicator for 12-hour clock
%S
Second (00 - 59)
%U
Week of year, with Sunday as first day of week (00 - 51)
%w
Weekday (0 - 6; Sunday is 0)
%W
Week of year, with Monday as first day of week (00 - 51)
%x
Date representation for current locale
%X
Time representation for current locale
%y
2-digit year (00 - 99)
%Y
4-digit year
%z, %Z
Time zone name or abbreviation; no output if time zone is unknown
%%
Percent sign
Description
DATE_STRING
returns the date string of the Julian date. If
output_format
is not provided, the default keyword
DELIM_M_D_Y
will be used.
Examples
DATE_STRING(730729)
returns the string "08/31/00".
See
DATE
for additional information on valid date formats.
Related Functions
Function
Description
DATE
Converts a date string to a Julian date.
DATE_JULIAN
Returns the Julian date of the input.
DATE_FORMAT
Converts dates from one format to another.
Copyright IBM Corporation 2013. All Rights Reserved.