cf.TimeDuration.is_day_factor¶
-
TimeDuration.
is_day_factor
()[source]¶ Return True if an integer multiple of the time duration is equal to one day.
New in version 1.0.
Examples 1: >>> cf.TimeDuration(0.5, 'days').is_day_factor() True
Returns: out: bool
Examples 2: >>> cf.TimeDuration(1, 'days').is_day_factor() True >>> cf.TimeDuration(0.25, 'days').is_day_factor() True >>> cf.TimeDuration(0.3, 'days').is_day_factor() False >>> cf.TimeDuration(2, 'days').is_day_factor() False
>>> cf.TimeDuration(24, 'hours').is_day_factor() True >>> cf.TimeDuration(6, 'hours').is_day_factor() True >>> cf.TimeDuration(7, 'hours').is_day_factor() False >>> cf.TimeDuration(27, 'hours').is_day_factor() False
>>> cf.TimeDuration(1440, 'minutes').is_day_factor() True >>> cf.TimeDuration(15, 'minutes').is_day_factor() True >>> cf.TimeDuration(17, 'minutes').is_day_factor() False >>> cf.TimeDuration(2007, 'minutes').is_day_factor() False
>>> cf.TimeDuration(86400, 'seconds').is_day_factor() True >>> cf.TimeDuration(45, 'seconds').is_day_factor() True >>> cf.TimeDuration(47, 'seconds').is_day_factor() False >>> cf.TimeDuration(86401, 'seconds').is_day_factor() False
>>> cf.TimeDuration(1, 'calendar_months').is_day_factor() False >>> cf.TimeDuration(1, 'calendar_years').is_day_factor() False