cf.h

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').

See also

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

New in version 1.0.

Parameters:
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.

Example:

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

Returns:
out: cf.TimeDuration

The new cf.TimeDuration object.

Examples:
>>> cf.h()
<CF TimeDuration: 1 hour (from Y-M-D h:00:00)>
>>> cf.h(3, minute=15)
<CF TimeDuration: 3 hours (from Y-M-D h:15:00)>
>>> cf.h(0.5)
<CF TimeDuration: 0.5 hours (from Y-M-D h:00:00)>
>>> cf.h(6.5, minute=15, second=45)
<CF TimeDuration: 6.5 hours (from Y-M-D h:15:45)>
>>> cf.h(0)
<CF TimeDuration: 0 hours (from Y-M-D h:00:00)>