Catalog of DIESEL String Functions
Format phrases are defined as shown in the following table. Assume that the date and time are Saturday, 5 September 1998 4:53:17.506.
Format | Output | Format | Output |
D | 5 | H | 4 |
DD | 05 | HH | 04 |
DDD | Sat | MM | 53 |
DDDD | Saturday | SS | 17 |
M | 9 | MSEC | 506 |
MO | 09 | AM/PM | AM |
MON | Sep | am/pm | am |
MONTH | September | A/P | A |
YY | 98 | a/p | a |
YYYY | 1998 |
Note: Enter the entire AM/PM phrase as shown in the preceding table; if AM is used alone, the A will be read literally and the M will return the current month.
If any AM/PM phrases appear in the picture, the H and HH phrases edit the time according to the 12-hour civil clock (12:0012:59 1:0011:59) instead of the 24-hour clock (00:0023:59).
The following example uses the date and time from the preceding table. Notice that the comma must be enclosed in quotation marks because it is read as an argument separator.
$(edtime, $(getvar,date),DDD"," DD MON YYYY - H:MMam/pm)
It returns the following:
Sat, 5 Sep 1998 - 4:53am
If time is 0, the time and date at the moment that the outermost macro was executed is used. This avoids lengthy and time-consuming multiple calls on $(getvar,date) and guarantees that strings composed with multiple $(edtime) macros all use the same time.