cf.hour

cf.hour(value)[source]

A Query object for a “hour of the day” condition.

Parameter
value:

The query condition’s value.

Returns
Query

The query object.

In this context, any object which has a hour attribute is considered to be a date-time variable.

If value is a Query object then cf.hour(value) is equivalent to value.addattr('hour'). Otherwise cf.hour(value) is equivalent to cf.eq(value, attr='hour').

Parameters
value:

Either the value that the hour is to be compared with, or a Query object for testing the hour.

Returns
Query

The 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