|
The time conversion code converts a time from its internal representation (number of seconds since midnight) to a string representing hours, minutes and seconds or vice versa.
The full format of this conversion code is
MT {M} {H} {S} {c}
where
| M | specifies that the time value to be converted is in milliseconds (output conversion only). |
| H | specifies that the time is to appear in 12-hour format with either "am" or "pm" appended. If H is not specified, 24-hour conversion is used for output conversion and assumed for input conversion. If the AMPM.UPCASE mode of the OPTION command is active, the appended suffix is in uppercase (AM or PM). |
| S | specifies that output conversion is to include the seconds field. If the M option is also present, a period and the three digit fractional seconds value will be included in the converted output. Input conversion determines whether seconds are included by examination of the data to be converted and may not include a fractional element. |
| c | is the character to separate the hours, minutes and seconds fields. If omitted, a colon is used. The separator character should be enclosed in quotes if required to avoid syntactic ambiguity (for example MT'h' for French format times such as 09h30). A pair of adjacent quotes can be used to specify that no separator is to be inserted. |
The optional M, H and S qualifiers may be in any order.
When used as an input conversion, a four digit time such as "0800" will be treated as hours and minutes, hhmm.
Examples
Output Conversion
|
Data
|
Result
|
MT
|
0
|
00:00
|
MT
|
31653
|
08:47
|
MT
|
63306
|
17:35
|
MTH
|
0
|
12:00am
|
MTH
|
31653
|
08:47am
|
MTH
|
63306
|
05:35pm
|
MTS
|
31653
|
08:47:33
|
MTS
|
63306
|
17:35:06
|
MTHS
|
63306
|
05:35:06pm
|
MTS.
|
63306
|
17:35:06
|
MTMS
|
33888250
|
09:24:48.250
|
MT'h'
|
63306
|
17h35
|
MT''
|
63306
|
1735
|
Input Conversion
|
Data
|
Result
|
MT
|
00:00
|
0
|
MT
|
10:45
|
38700
|
MT
|
12:01AM
|
60
|
MT
|
12:01PM
|
43260
|
MT
|
0800
|
28800
|
See also:
Dates, Times and Epoch Values
|