Time Conversion (MT)

Time Conversion (MT)

Top  Previous  Next

 

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

 

Mspecifies that the time value to be converted is in milliseconds (output conversion only).

 

Hspecifies 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).

 

Sspecifies 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.

 

cis 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.

 

 

Examples

 

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

 

 

See also:

Dates, Times and Epoch Values