pyds.DateTime¶
- class pyds.DateTime(year, month, day, hour, minute, second=None, utc=False, zone_hour=None, zone_minute=None)¶
Bases: pyds.Scalar
Represents a PDS date-time value.
- Parameters
year (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.
hour (int)
minute (int)
-
Whether the time is in UTC or not.
-
If utc is True and zone_hour is not None, zone_hour is stored, but when Time is serialized, it’s serialized ignoring zone_hour.
- Raises
-
- 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).
- If hour is not between 0 and 23.
- If minute is not between 0 and 59.
- If second is not None and not between 0 and 59.
- If zone_hour is not None and not between -12 and 12.
- If zone_hour is not None and zone_minute is not between 0 and 59.
- Attributes
Special Methods