Time and Date Formats
Each type of data and time value needs to be entered in a specific format. There are special codes that allow the program to recognize the type of time or date value being used, and there are conventions for entering the times and dates.
The format conventions are:
- TIME—There are two formats for TIME values: short and long. The short format uses T# to represent TIME, whereas the long format uses TIME#. Usually, the short format is used, but you may wish to use the long format for its improved readability.
Both formats use these characters:
- d—day
- h—hours
- m—minutes
- s—seconds
- ms—milliseconds
For example, T#12d3h2s is 12 days, 3 hours, and 2 seconds in the short format. In the long format, the same amount of time is TIME#12d_3h_2s.
- DATE—As with TIME values, there are short and long formats for DATE values. The short format uses D# to represent DATE, whereas the long format uses DATE#.
- TIME_OF_DAY—As with other types of time and date values, TIME_OF_DAY values can use short and long formats. The short format uses TOD# to represent TIME_OF_DAY whereas the long format uses TIME_OF_DAY#.
- DATE_AND_TIME—As with other types of time and date values, DATE_AND_TIME values can use short and long formats. The short format uses DT# to represent DATE_AND_TIME whereas the long format uses DATE_AND_TIME#.