Return a comparison object for the hour of the day of a date-time object.
In this context, a date-time object is any object which has a hour attribute.
If value is a cf.Comparison object then cf.hour(value) is equivalent to value.addattr('hour'). Otherwise cf.hour(value) is equivalent to cf.eq(value, attr='hour').
Parameters : |
|
---|---|
Returns : |
|
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