In this module:
PartialDateTime object specifies values for some subset of
the calendar/time fields (year, month, hour, etc.) for comparing
Comparisons are defined against any other class with all of the
attributes: year, month, day, hour, minute, and second.
Notably, this includes
cftime.datetime. Comparison also extends to the
microsecond attribute for classes, such as
datetime.datetime, which define it.
PartialDateTime object is not limited to any particular
calendar, so no restriction is placed on the range of values
allowed in its component fields. Thus, it is perfectly legitimate to
create an instance as: PartialDateTime(month=2, day=30).
- class iris.time.PartialDateTime(year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None)[source]#
Allows partial comparisons against datetime-like objects.
For example, to select any days of the year after the 3rd of April:>>> from iris.time import PartialDateTime >>> import datetime >>> pdt = PartialDateTime(month=4, day=3) >>> datetime.datetime(2014, 4, 1) > pdt False >>> datetime.datetime(2014, 4, 5) > pdt True >>> datetime.datetime(2014, 5, 1) > pdt True >>> datetime.datetime(2015, 2, 1) > pdt False
The day number as an integer, or None.
The hour number as an integer, or None.
The microsecond number as an integer, or None.
The minute number as an integer, or None.
The month number as an integer, or None.
The second number as an integer, or None.
- timetuple = None#
The year number as an integer, or None.