cf.D¶
-
cf.
D
(duration=1, month=1, day=1, hour=0, minute=0, second=0)[source]¶ Return a time duration of days in a
cf.TimeDuration
object.cf.D()
is equivalent tocf.TimeDuration(1, 'day')
.New in version 1.0.
Parameters: - duration: number, optional
The number of days 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.D(hour=12)
is equivalent tocf.TimeDuration(1, 'day', hour=12)
.
Returns: - out:
cf.TimeDuration
The new
cf.TimeDuration
object.
Examples: >>> cf.D() <CF TimeDuration: 1 day (from Y-M-D 00:00:00)>
>>> cf.D(5, hour=12) <CF TimeDuration: 5 days (from Y-M-D 12:00:00)>
>>> cf.D(48.5, minute=30) <CF TimeDuration: 48.5 days (from Y-M-D 00:30:00)>
>>> cf.D(0.25, hour=6, minute=30, second=20) <CF TimeDuration: 0.25 days (from Y-M-D 06:30:20)>
>>> cf.D(0) <CF TimeDuration: 0 days (from Y-M-D 00:00:00)>