This section describes the uxtim command used to converts a time (with or without a date) in a specified format and allow the specification of a time offset.
For a known date, the command syntax is as follows:
uxtim "Source date time format" "Source date time" "Target date time format" "Time offset"
For example:
uxtim "hhMM ap" "0600 PM" "HH:MM" "-0h10"
For the execution date and time of the command, the command syntax is as follows:
uxtim "Target date time format" "Time offset" [NOW]
For example:
uxtim "aaaa, mmmm, jj HH:MM AP" "+2h50" NOW
On OpenVMS, uxtim sets the global symbol UXTIM_VALUE.
Description of Items
Source date time format and Target date time format
Respectively, the date format to be converted and the target format.
The time format uses the HH symbol for the hour, the MM symbol for the minutes and AP to specify the time format (in 12h format).
Example "15012003,1506" has for format "DDMMYYYY,HHMM".
Date Format |
International |
French |
---|---|---|
Position of month as 01-12 |
mm |
mm |
Month as Jan to Dec (jan to dec) |
mmm |
mmm |
Month as January to December (january to december) |
mmmm |
mmmm |
Position of day in month as 01-31 |
dd |
jj |
Position of day in week as 1 to 7 |
p |
p |
Position of day in week as mon to sun (mon to sun) |
ddd |
jjj |
Position of day in week as Monday to Sunday (monday to sunday) |
dddd |
jjjj |
Position of week in year as 01-52 |
ww |
ss |
Position of day in year as 001-365 |
qqq |
qqq |
Year as 00 to 99 |
yy |
aa |
Year as 0000 to 9999 |
yyyy |
aaaa |
Source date time
Date and time to be converted in the specified format specified as Target date time format.
To be specified with Source date time format.
Time offset
Offset to be applied to the specified date and time or to the actual date and time if the parameter NOW is used.
Format: +/-HHHhMM:
Examples
"0600 PM" is converted to the (hhMM ap), format. There is no offset.
% uxtim "hhMM ap" "0600 PM" "HH:MM"
18:00
"0600 PM" is not converted (no output format and no offset).
% uxtim "hhMM ap" "0600 PM"
0600 PM
The current date and time is converted to the specified format (no offset).
% uxtim NOW "aaaa, mmmm, jj HH:MM AP"
2003, mars, 05 03:30 PM
The current date and time is converted to the specified format with an offset of 2h50.
% uxtim NOW "aaaa, mmmm, jj HH:MM AP" "+2h50"
2003, mars, 05 06:20 PM
The "21 January 2003 6h26 PM" is converted to the specified format, no offset.
% uxtim "aaaa, mmmm, jj HH:MM AP" "2003, JANUARY, 21 06:26 PM" "jj/mm/aa"
21/01/03