cf.Y

cf.Y(duration=1, year=None, month=1, day=1, hour=0, minute=0, second=0)[source]

Return a time duration of calendar years in a cf.TimeDuration object.

cf.Y() is equivalent to cf.TimeDuration(1, 'calendar_year').

See also

cf.M, cf.D, cf.h, cf.m, cf.s

New in version 1.0.

Parameters:
duration : int, optional

The number of calendar years in the time duration. Must be a non-negative integer.

year, month, day, hour, minute, second : ints, optional

The default date-time elements for defining the start and end of a time interval based on this time duration. See cf.TimeDuration and cf.TimeDuration.interval for details.

Example:

cf.Y(month=12) is equivalent to cf.TimeDuration(1, 'calendar_years', month=12).

Returns:
out : cf.TimeDuration

The new cf.TimeDuration object.

Examples:
>>> cf.Y()
<CF TimeDuration: 1 calendar year (from Y-01-01 00:00:00)>
>>> cf.Y(10, month=12)   
<CF TimeDuration: 10 calendar years (from Y-12-01 00:00:00)>
>>> cf.Y(15, month=4, day=2, hour=12, minute=30, second=2)  
<CF TimeDuration: 15 calendar years (from Y-04-02 12:30:02)>
>>> cf.Y(0)       
<CF TimeDuration: 0 calendar years (from Y-01-01 00:00:00)>

Previous topic

cf.dt

Next topic

cf.M

This Page