The year formatting directives
You can use these formatting directives in the display format of the GL_DATE environment variable to format the year of a date string: %y, %iy, %Y, and %iY.
The %iy and %iY formatting directives provide compatibility with the Y2 and Y4 year specifiers of the DBDATE environment variable.
- The %iy and %y formatting directives both print the year of an internal date value as a
two-digit decade.
For example, when you set GL_DATE to '
%y %m %d
' or '%iy %m %d
', an internal date for March 5, 1997 formats to '97 03 05'. - The %iY and %Y formatting directives both print the year of an internal date value as a
four-digit year.
For example, when you set GL_DATE to '
%Y %m %d
' or '%iY %m %d
', the internal date for March 5, 1997 formats to '1997 03 05'.
GL_DATE format | '1994 03 06' date string to read | '94 03 06' date string to read |
---|---|---|
%y %m %d | Error | Internal date for 1994 03 06 |
%iy %m %d | Internal date for 1994 03 06 | Internal date for 1994 03 06 |
%Y %m %d | Internal date for 1994 03 06 | Internal date for 0094 03 06 |
%iY %m %d | Internal date for 1994 03 06 | Internal date for 1994 03 06 |
In a read of a date string, the %iy and %y formatting directives both prefix the first two digits of the current year to expand any one-digit or two-digit year. You can set the DBCENTURY environment variable to change this default.