cf.year¶
-
cf.
year
(value)[source]¶ Return a
cf.Query
object for date-time years.In this context, any object which has a
year
attribute is considered to be a date-time variable.If value is a
cf.Query
object thencf.year(value)
is equivalent tovalue.addattr('year')
. Otherwisecf.year(value)
is equivalent tocf.eq(value, attr='year')
.See also
cf.year
,cf.month
,cf.day
,cf.hour
,cf.minute
,cf.second
,cf.dteq
,cf.dtge
,cf.dtgt
,cf.dtne
,cf.dtle
,cf.dtlt
Parameters: - value :
Either the value that the year is to be compared with, or a
cf.Query
object for testing the year.
Returns: - out : cf.Query
The query object.
Examples: >>> d = cf.dt(2002, 6, 16) >>> d == cf.year(2002) True >>> d == cf.year(cf.le(2003)) True >>> d == cf.year(2001) False >>> d == cf.year(cf.wi(2003, 2006)) False