Was this helpful?
Date Data Type
Date data type columns hold absolute dates, absolute times, or time intervals. Date data types can contain any valid date between January 1, 1582 and December 31, 2382. When used in database language commands, date data types are enclosed in quotation marks as are text types.
An absolute date is a time, such as 12:30 on November 13. There are many ways of expressing absolute dates and time.
For example, you can express the date December 25, 1998, in any of the following ways:
mm/dd/yy                         12/25/98
dd‑mmm‑yyyy                      25‑Dec‑1998
mm‑dd‑yyyy                       12‑25‑1998
yyyy.mm.dd                       1998.12.25
mm/dd                            12/25
mm‑dd                            12‑25
mmddyy                           122598
mm/dd/yy hh:mm:ss  ampm          12/25/98 10:30:30 am
You can express the time 10:30 a.m. as:
hh:mm:ss ampm tz                10:30:00 am pst
You can also use now or today to mean the current date and time (now), or current date only (today).
Various conventions for date and time are recognized. For example, it assumes a 24‑hour clock unless you specify p or p.m. The program adjusts dates and times to the designated time zone, such as Pacific Standard Time.
For information on how to specify various date display formats, see Data Display and Input Formats.
International Conventions for Date and Time
International date and time conventions can also be adapted. For example, dates in Sweden and Finland are expressed as a year, followed by the month, followed by the day. The standard German date format can be expressed as ddmmyy, ddmmyyy, dd.mm.yy, and dd.mm.yyyy. The date format is set by the system variable II_DATE_FORMAT.
The time zone is set with the system variable, II_TIMEZONE_NAME. These dates are stored in Greenwich mean time. The conversion between Greenwich and your local time is a value set with II_TIMEZONE_NAME. For more information, see the System Administrator Guide for the system on which your database resides.
Relative Times and Dates
Relative time and date intervals are also handled, which are units of time not fixed as absolutes. An example of a relative time interval is:
5 years 8 months 14 days
You can use the interval and date functions to carry out operations on dates in SQL or in the Interactive Terminal Monitor. The interval function calculates the difference between two dates. The date conversion function transforms strings into dates.
Last modified date: 01/30/2023