# mt (mask time) processing code

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.

 Note: When using an ADI with an mt processing code, a null value is converted
 to zero before testing for equality or inequality. Therefore, ADI = “” will find nothing and ADI
 # “” will return everything. This only affects “equal” or “not equal”. “Less than or equal”,
 “Greater than or equal” and others are not affected.

| 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

- [Conversion expression](https://d3codex.com/pickbasic-flashbasic/conversion-expression/)
- [Processing codes (Update processor)](https://d3codex.com/updateprocessor/processing-codes-update-processor/)
- [External format](https://d3codex.com/definitions/external-format/)
- [iconv() function](https://d3codex.com/pickbasic-flashbasic/iconv-function/)
- [Internal format](https://d3codex.com/definitions/internal-format/)
- [output-conversion](https://d3codex.com/attributedefiningitem/output-conversion/)
- [Processing codes overview](https://d3codex.com/processingcodes/processing-codes-overview/)
- [time() function](https://d3codex.com/pickbasic-flashbasic/time-function/)
- [timedate() function](https://d3codex.com/pickbasic-flashbasic/timedate-function/)

---
Source: https://d3codex.com/processingcodes/mt-mask-time-processing-code/ - part of the D3Codex reference.
