Returns a formatted date and time based on a given picture.
$(edtime, time , picture )
Edits the AutoCAD Julian date given by time (obtained, for example, from $(getvar,date) according to the given picture). The picture consists of format phrases replaced by specific representations of the date and time. Characters not interpretable as format phrases are copied literally into the result of $(edtime). 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 |
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:00-12:59 1:00-11:59) instead of the 24-hour clock (00:00-23: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)
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.