fundamentals.times¶
Some time functions to be used with logging etc
- Author
David Young
Module Contents¶
Functions¶
Return the time difference between two dates as a string |
|
convert date to a relative datetime (e.g. +15m, +2hr, +1w) |
|
A datetime stamp in MySQL format: ‘YYYY-MM-DDTHH:MM:SS’ |
API¶
- fundamentals.times.calculate_time_difference(startDate, endDate)[source][source]¶
Return the time difference between two dates as a string
Key Arguments
startDate– the first date in YYYY-MM-DDTHH:MM:SS formatendDate– the final date YYYY-MM-DDTHH:MM:SS format
Return
relTime– the difference between the two dates in Y,M,D,h,m,s (string)
Usage
from fundamentals import times diff = times.calculate_time_difference(startDate="2015-10-13 10:02:12", endDate="2017-11-04 16:47:05") print diff # OUT: 2yrs 22dys 6h 44m 53s