First page Back Continue Last page Overview Text


The second piece of data that all standard date and datetime objects store is the offset from UTC.

Now for datetimes, this makes sense, as they need to store the offset, in order to be able to accurately compare times in different time zones. However, dates themselves shouldn't really have an offset, as a date is not a particular time in a particular zone, but a 24 time period not usually particular to any zone. In general, if you need to specify a zone, you should be talking about a datetime and not just a date.

Anyway, in the standard library, the offset for a Date object is always 0, unless you want to call a private method.