cf.day

cf.day(value)[source]

Return a comparison object for the day of the month of a datetime variable.

In this context, a datetime variable is any object which has a day attribute.

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

Parameters :
value :

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

Returns :
out : cf.Comparison

The comparison object.

Examples

>>> d = cf.dt(2002, 6, 16)
>>> d == cf.day(16)
True
>>> d == cf.day(cf.le(19))
True
>>> d == cf.day(7)
False
>>> d == cf.day(cf.wi(1, 21))
True

Previous topic

cf.month

Next topic

cf.hour

This Page