cf.second

cf.second(value)[source]

Return a comparison object for the second of the minute of a datetime variable.

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

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

Parameters :
value :

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

Returns :
out : cf.Comparison

The comparison object.

See also

year, month, day, hour, minute, dteq, dtge, dtgt, dtne, dtle, dtlt

Examples

>>> d = cf.dt(2002, 6, 16, 18, 30, 0)
>>> d == cf.second(0)
True
>>> d == cf.second(cf.le(30))
True
>>> d == cf.second(30)
False
>>> d == cf.second(cf.wi(0, 30))
True

Previous topic

cf.minute

Next topic

cf.dteq

This Page