cf.month

cf.month(value)[source]

Return a cf.Query object for date-time months.

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

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

Parameters:
value :

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

Returns:
out : cf.Query

The query object.

Examples:
>>> d = cf.dt(2002, 6, 16)
>>> d == cf.month(6)
True
>>> d == cf.month(cf.le(7))
True
>>> d == cf.month(7)
False
>>> d == cf.month(cf.wi(1, 6))
True

Previous topic

cf.year

Next topic

cf.day

This Page