The mt processing code invokes the time conversion function to convert external time representations to internal format or to convert internal time values to one of a variety of external time formats.
The internal time format is the number of seconds from midnight. The external time format is 24-hour military format (for example, 23:25:59) or 12-hour format (for example, 11:25:59PM).
For input-conversion, the time is entered with am or pm immediately following the numeric time. If none is entered, am is assumed. On output, am or pm is always printed immediately following the numeric time.
NOTE |
12:00AM is midnight and 12:00PM is noon. AM and PM are ignored on input if the mt code is specified. Illegal values are converted to null on input. |
When used as an input-conversion, the mt code validates the time and converts it to the internal format of seconds from midnight. When updating a field controlled by an mt conversion, the / character can be used to insert the current time into the attribute.
System Processors |
Update, List |
Code Type |
Attribute Defining |
Dictionary Attributes |
Input Conversion, Output Conversion, Correlative |
Syntax
mt{h}{s} |
Parameter(s)
h |
Specifies a 12-hour clock. Default is (military) a 24-hour clock. When specifying the h parameter, the range of values for the internal format representation are from 0 to 86399. |
s |
Includes seconds in output value. If omitted, seconds are not listed on output. |
Example(s)
Data |
Code |
Sample Output |
3600 |
mt |
01:00 |
3600 |
mth |
01:00am |
3600 |
mts |
01:00:00 |
3600 |
mths |
01:00:00am |
46800 |
mt |
13:00 |
46800 |
mth |
01:00pm |
3630 |
mts |
01:00:30 |
46800 |
mths |
01:00:00pm |
See Also
Correlative Processing Codes (ADI)
Input-Conversion Processing Codes