Chapter 2 -- HEADER Section
HEADER Section Group Codes
Special Handling of Date/Time Variables

The CDATE and DATE system variables provide access to the current date and time. The TDCREATE, TDINDWG, TDUPDATE, and TDUSRTIMER system variables (and the $TDCREATE, $TDUCREATE, $TDUPDATE, and $TDUUPDATE DXF header variables) provide access to times and dates associated with the current drawing. The values are represented as real numbers with special meanings, as described below.

DATE is the current date and time represented as a Julian date and fraction of a day in a real number.

For example, on December 31, 1999, at 9:58:35 p.m. GMT, the DATE variable contains

The date and time are taken from the computer's clock when the variable is read. The time is represented as a fraction of a day, do the times returned by DATE may be truly subtracted to compute differences in time. To extract the seconds since midnight from the value returned by DATE, use the AutoLISP expressions:

Note that DATE only returns a true Julian date if the system's 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.

TDINDWG and TDUSRTIMER (and the $TDINDWG and $TDUSRTIMER DXF header variables) use a format similar to that of DATE, but their values represent elapsed times, as in:

CDATE is the current date and time in calendar and clock format. The value is returned as a real number in the form:


YYYY = year
MM = month (01 - 12)
DD = day (01 - 31)
HH = hours (00 - 23)
MM = minutes (00 - 59)
SS = seconds (00 - 59)
hsec = hundredths of a second (00 - 99)

For example, if the current date is December 31, 1999, and the time is 9:58:35.75 p.m., CDATE would return the value:

Note that CDATE values can be compared for later and earlier values but that subtracting them yields numbers that are not meaningful.