A class for date handling. For general usage, see the Usage section.
Valid values for date can be:
The class can also be initialized using the keyword arguments year, month, and day:
Date(year=2000, month=10, day=16)
If both date and keywords are specified, date takes precedence.
Makes sure the object has a full date set, ie the attributes chrono.Date.year, chrono.Date.month, and chrono.Date.day are not None.
Raises chrono.error.NoDateTimeError on missing attributes.
Formats the date using template, replacing variables as supported by chrono.formatter.Formatter.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the date as a tuple of year, month, and day.
Raises chrono.error.NoDateTimeError on missing date data.
Returns a datetime.date instance based on the date.
Raises chrono.error.NoDateTimeError on missing date data.
Returns a string representation (yyyy-mm-dd) of the date.
Raises chrono.error.NoDateTimeError on missing date data.
Returns a time.struct_time representation of the date (expected as input to many Python functions).
Raises chrono.error.NoDateTimeError on missing date data.
Returns a UNIX timestamp representation of the date.
Raises chrono.error.NoDateTimeError on missing date data.
Returns True if the date is in a leap year, otherwise False.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the number of days in the set month.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the ordinal day (day number in the year) of the set date.
Raises chrono.error.NoDateTimeError on missing date data.
Sets the date.
Raises chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError for invalid values.
Sets the date from a string.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and an appropriate chrono.error.DateError subclass for invalid date values.
Returns the week of the set date as a tuple with year and week number.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the week date of the set date as a tuple with year, week, and weekday.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the week day of the set date, or None if no date is set.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the number of weeks in the set year.
Raises chrono.error.NoDateTimeError on missing date data.
Returns the number of days in the year.
Raises chrono.error.NoDateTimeError on missing date data.