cf.hour¶
-
cf.hour(value)[source]¶ A
Queryobject for a “hour of the day” condition.See also
cf.year,cf.month,cf.day,cf.minute,cf.second,cf.seasons,cf.djf,cf.mam,cf.jja,cf.son- Parameter
- value:
The query condition’s value.
- Returns
QueryThe query object.
In this context, any object which has a
hourattribute is considered to be a date-time variable.If value is a
Queryobject thencf.hour(value)is equivalent tovalue.addattr('hour'). Otherwisecf.hour(value)is equivalent tocf.eq(value, attr='hour').- Parameters
- value:
Either the value that the hour is to be compared with, or a
Queryobject for testing the hour.
- Returns
QueryThe query object.
Examples
>>> d = cf.dt(2002, 6, 16, 18) >>> d == cf.hour(18) True >>> d == cf.hour(cf.le(19)) True >>> d == cf.hour(7) False >>> d == cf.hour(cf.wi(6, 23)) True