additions to datetime standard library
-
datetime2.datetimef(d, t=datetime.time(0, 0), fmt='%Y-%m-%d')[source]
converts something to a datetime
-
datetime2.datef(d, fmt='%Y-%m-%d')[source]
converts something to a date
-
datetime2.timef(t, fmt='%Y-%m-%d')[source]
converts something to a time
-
datetime2.strftimedelta(v, fmt=None)[source]
formats a timedelta
-
datetime2.tdround(td, s=1)[source]
return timedelta rounded to s seconds
-
datetime2.daysgen(start, length, step=datetime.timedelta(1))[source]
returns a range of dates or datetimes
-
datetime2.days(start, length, step=datetime.timedelta(1))[source]
-
datetime2.timedelta_sum(timedeltas)[source]
-
datetime2.timedelta_div(t1, t2)[source]
divides a timedelta by a timedelta or a number.
should be a method of timedelta...
-
datetime2.timedelta_mul(t1, t2)[source]
multiplies a timedelta. should be a method of timedelta...
-
datetime2.time_sub(t1, t2)[source]
substracts 2 time. should be a method of time...
-
datetime2.time_add(t, d)[source]
adds delta to time. should be a method of time...
-
datetime2.datetime_intersect(t1, t2)[source]
returns timedelta overlap between 2 intervals (tuples) of datetime
-
datetime2.time_intersect(t1, t2)[source]
returns timedelta overlap between 2 intervals (tuples) of time
-
class datetime2.TestCase(methodName='runTest')[source]
Bases: unittest.case.TestCase
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
-
runTest()[source]