Use the #Variable object to display a DT variable in the 12-hour time system
See #Variable format for the DT type.
Example:
%[HH:MM:SS P]DT
|
02:00:00 -> 02:00:00 AM
14:00:00 -> 02:00:00 PM
|
%[HH:MM:SS p]DT
|
02:00:00 -> 02:00:00 am
14:00:00 -> 02:00:00 pm
|
Set or display the system time in the 12-hour time system
The following system variables are relevant for the hours time system:
Variable
|
Data type
|
Read/Write
|
Description
|
/S/APP/Tm_UseAmPm
|
BOOL
|
R/W
|
0 -> 24-hour time system ( 0-23)
1 -> 12-hour time system ( 1-12)
This variable has direct affect to time formats:
If 1 then %[HH:MM:SS]DT is converted to %[HH:MM:SS P]DT
|
/S/SYS/Tm_Hour
|
WORD
|
R/W
|
The hours of the actual or set system time in 12 or 24-hour time system
|
/S/SYS/Tm_HourMax
|
|
R
|
Contains the highest hour of the actual hour time system.
12-hour time system: 12
24-hour time system: 23
This variable can be used as Limit2 to limit the hour input.
|
/S/SYS/Tm_IsPm
|
BOOL
|
R/W
|
Indicates AM/PM:
0 -> AM
1 -> PM
|
Example:
In order to switch to the 12-hour time system:
In order to switch the time in the 12-hour system to 15:00
|