pyds.Date

class pyds.Date(year, month, day)

Bases: pyds.Scalar

Represents a PDS date value.

Parameters
  • year (int)

  • month (None or int)

    If None, then day is interperated as the day of the year instead of as the day of the month, and Date serialized in ‘day-of-year’ format.

  • day (int)

    The day of the month if month is not None. Otherwise it’s the day of the year.

Raises
  • ValueError
    • If month is not None and not between 1 and 12.
    • If month is not None and day is not between 1 and the number of days in the month month.
    • If month is None and day is not between 1 and the number of days in the year year (365 or 366 depending on if it’s a leap year).
Attributes
year

int. Read-only.

month

None or int. Read-only.

day

Day of year if month is None. Otherwise, day of the month of month month. int. Read-only.


Special Methods

Date.__str__()

Return a PDS serialized string (str) representing the object.

Called by str().