Inherits Garbage
The Date class contains a date, with attendant time and timezeone.
It can parse RFC 822 format dates, as well as encode dates in rfc822, imap and ISO-8601 formats. It cannot change itself or interact with other dates: This is meant purely as parse-and-store class.
Constructs an empty, invalid Date.
Reimplements Garbage::Garbage().
Checks that a presumably valid date really is. Flags November 31 as invalid, all dates before 1900 ditto, etc, etc.
Returns the date's day-of-month (1-31), or 0 if the date isn't valid().
Returns this Date's hour (0-23), or 0 if the Date isn't valid.
Returns an IMAP-format date-time, or an empty string if the date is invalid.
(date-day-fixed "-" date-month "-" date-year SP time SP zone)
Returns the date part of the object as a ten-character ISO8601 date, eg. "2004-02-29".
Returns the RFC 3339 (ISO 8601) format date (with date, time, offset all mangled together: YYYY-MM-DDTHH:MM:SS+NN:NN).
Returns the time part of the object as an eight-character ISO8601 string, e.g. "01:22:59".
Returns an empty string if the date is invalid.
Returns this Date's minute (0-59), or 0 if the Date isn't valid.
Returns the date's month (1 for January, 12 for December), or 0 if the date isn't valid().
Returns the timezone offset, or 0 if the date is invalid. Note that +0000 and -0000 are indistinguishable in the Date API.
Returns the date in RFC 822 format. If it's too far into the past or future, the weekday is omitted (as is legal).
Returns an empty string if the date is invalid.
Returns this Date's second (0-60), or 0 if the Date isn't valid.
Sets this date to point to the current date, time and timezone.
A version of setDate() that takes a month name instead of a number, for use with IMAP (as opposed to ISO) date-time. The year, day, hour, minute, second, and zone arguments are handled identically.
Sets the date to the supplied (in this order) year, month, day, hour, minute, second, zone, all of which are presumed to be sensible. If they aren't sensible, the object becomes invalid.
Parses dt as an RFC 3339 (ISO 8601) format date and sets it.
Transforms this Date from whatever time zone it is currently in to the local time zone, whatever that is.
Sets this date object to reflect the RFC 2822-format date s. If there are any syntax errors, the date is set to be invalid.
A number of common syntax errors are accepted.
Transforms this Date to be in the time zone z, which must be in "[+-]HHMM" format. If z is in any way invalid, the Date will not be valid() afterwards. If z is "-0000", this function does nothing (as a concession to Sieve's :originalzone).
Sets this date to t seconds after the start of 1970, give or take a few leap seconds. t is assumed to be UTC.
Returns the unix time corresponding to this data, or 0 if the data is invalid.
Returns true if the object is a legal date, and false if the date is meaningless, unparsable or uninitialized.
Returns this Date's day-of-week (0..6, with 0 being Sunday), or 0 if the Date isn't valid.
Returns the date's year, or 0 in case the date isn't valid().
This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.