cf.Y¶
-
cf.
Y
(duration=1, 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 tocf.TimeDuration(1, 'calendar_year')
.cf.Y(duration, *args, **kwargs)
is equivalent tocf.TimeDuration(duration, 'calendar_year', *args, **kwargs)
.New in version 1.0.
Parameters: - duration: number, optional
The number of calendar years in the time duration.
- month, day, hour, minute, second:
int
, optional The default date-time elements for defining the start and end of a time interval based on this time duration. See
cf.TimeDuration
andcf.TimeDuration.interval
for details.- Example:
cf.Y(month=12)
is equivalent tocf.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)>