# How to programmatically determine information about a DateObject

(This question was inspired by my off-target answer to the question How to get the size of a DateObject?). The answer was not obvious to me, so I think a question/answer for this would be useful)

How can I programmatically determine properties like the time zone, calendar type and granularity of a DateObject without examining it's full form? For example:

date = CurrentDate[Now, "Week"];
date //InputForm


DateObject[{2018, 2, 26}, "Week", "Gregorian", -8.]

Is there an accessor function that will return "Week", "Gregorian" and -8?

## 1 Answer

You can use the accessor function DateValue to do this. For example:

DateValue[date, {"Granularity", "TimeZone", "CalendarType"}]


{"Week", -8., "Gregorian"}