Return a time duration of seconds in a cf.TimeDuration object.
cf.s() is equivalent to cf.TimeDuration(1, 'second').
New in version 1.0.
Parameters: |
|
---|---|
Returns: |
|
Examples: |
>>> cf.s()
<CF TimeDuration: 1 second (from Y-01-01 00:00:00)>
>>> cf.s().interval(1999, 12, 1)
(<CF Datetime: 1999-12-01 00:00:00>, datetime.datetime(1999, 12, 1, 0, 0, 1))
>>> cf.s(30)
<CF TimeDuration: 30 seconds (from Y-01-01 00:00:00)>
>>> cf.s(0.5)
<CF TimeDuration: 0.5 seconds (from Y-01-01 00:00:00)>
>>> cf.s(12.25)
<CF TimeDuration: 12.25 seconds (from Y-01-01 00:00:00)>
>>> cf.s(2.5, year=1999, hour=12)
<CF TimeDuration: 2.5 seconds (from 1999-01-01 12:00:00)>
>>> cf.s(0)
<CF TimeDuration: 0 seconds (from Y-01-01 00:00:00)>