Share

AcDbDate

Class Hierarchy

AcDbDate

C++

class AcDbDate;

File

dbdate.h

Description

This class is used to pass date and time information to or from various AutoCAD ObjectARX functions.

This class exports a conventional representation of date and time as well as a Julian date and time representation. AutoLISP uses Julian dates. For reference, see the DATE system variable in the AutoCAD Command Reference.

Notes

This class does not rationalize or validate input. Be careful to check the state of the object against your input data before setting date elements individually. For instance, if you set the month to a value that is invalid for the current day setting, or vice versa, the internal Julian date calculation may yield unintended results, as shown below:

AcDbDate mydate(AcDbDate::kInitLocalTime);
// the date today happens to be 10/31/2005

// this call asks the date class to set the date to 9/31,
// which doesn't exist
mydate.setMonth(9);
// date has been 'rolled over' to 10/1

mydate.setDay(21);
// date is now 10/21 instead of 9/21

For best consistency and efficiency, use the setDate() function.

Links

AcDbDate Constructor, AcDbDate Enumerations, AcDbDate Methods, AcDbDate Operators

See Also

System variable DATE in the AutoCAD Command Reference

Was this information helpful?