MT

Converts data to and from time format.

MT

Syntax

MT [ H ] [ S ] [ separator]

MT with no options specifies that time is in 24-hour format, omitting seconds, with a colon used to separate hours and minutes, for example: 23:59.

H specifies an output format in 12-hour format with the suffix AM or PM.

S includes seconds in the output time.

separator is a nonnumeric character that specifies the separator used between hours, minutes, and seconds in the output.

Remarks

On output, MT defines the external output format for the time.

On input, MT specifies only that the data is a time, and the H and S options are ignored. If the input date has no minutes or seconds, they are assumed to be 0. For 12-hour formats, use a suffix of AM, A, PM, or P to specify morning or afternoon. If an hour larger than 12 is entered, a 24-hour clock is assumed. 12:00 AM counts as midnight and 12:00 PM counts as noon. The time is stored as the number of seconds since midnight. The value of midnight is 0.

Examples

The following examples show the effect of some MT conversion codes with the Iconv function:

Conversion Expression
Internal Value
X = Iconv("02:46", "MT")
X = 9960
X = Iconv("02:46:40am", "MTHS")
X = 10000
X = Iconv("02:46am", "MTH")
X = 9960
X = Iconv("02.46", "MT.")
X = 9960
X = Iconv("02:46:40", "MTS")
X = 10000

The following examples show the effect of some MT conversion codes with the Oconv function:

Conversion Expression
Internal Value
X = Oconv("02:46", "MT")
X = "02:46"
X = Oconv("02:46:40am", "MTHS")
X = "02:46:40am"
X = Oconv("02:46am", "MTH")
X = "02:46am"
X = Oconv("02.46", "MT.")
X = "02.46"
X = Oconv("02:46:40", "MTS")
X = "02:46:40"