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

Return a time duration of hours in a cf.TimeDuration object.

cf.h() is equivalent to cf.TimeDuration(1, 'hour').

New in version 1.0.

See also

cf.Y, cf.M, cf.D, cf.m, cf.s

duration: number, optional

The number of hours in the time duration.

year, 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 and cf.TimeDuration.interval for details.

Parameter example:

cf.h(minute=30) is equivalent to cf.TimeDuration(1, 'hour', minute=30).


The new cf.TimeDuration object.


>>> cf.h()
<CF TimeDuration: PT1H (Y-M-D h:00:00)>
>>> cf.h(3, minute=15)
<CF TimeDuration: PT3H (Y-M-D h:15:00)>
>>> cf.h(0.5)
<CF TimeDuration: PT0.5H (Y-M-D h:00:00)>
>>> cf.h(6.5, minute=15, second=45)
<CF TimeDuration: PT6.5H (Y-M-D h:15:45)>
>>> cf.h(0)
<CF TimeDuration: PT0H (Y-M-D h:00:00)>