Stores the current date and time in Modified Julian Date format.
Type: | Real |
Saved in: | Not-saved |
Initial value: | Varies |
The Modified Julian Date (MJD) format is a Julian day number with decimal fraction of a day:
<Julian day number>.<Decimal fraction of a day>
The Modified Julian Date, conventionally called UT1, is a worldwide scientific standard that assigns day numbers beginning at an essentially arbitrary date and time of 12:00 a.m. on 1 January 4713 B.C. (B.C.E.). With this system, 4 July 1997 at 2:29:58 p.m. corresponds to 2450634.60387736, and 1 January 1998 at 12:00 noon corresponds to 2450815.50000000.
Because the system clock provides the current date and time, the DATE system variable returns a true Julian date only if the system clock is set to UTC/Zulu (Greenwich Mean Time). TDCREATE and TDUPDATE have the same format as DATE, but their values represent the creation time and last update time of the current drawing.
You can compute differences in date and time by subtracting the numbers returned by DATE. The number of seconds since midnight can be computed by multiplying the decimal fraction of DATE by 86400 seconds.
AutoLISP can be used to calculate the number of seconds since midnight from the value returned by DATE.
(setq s (getvar "DATE")) (setq seconds (* 86400.0 (- s (fix s))))