Utility methods.
More...
|
| int | toEpochSecond (datetime instant) |
| | Get the second from the Epoch for this datetime.
|
| |
| int | toEpochDay (date day) |
| | Get the day from the Epoch for this date.
|
| |
| str | formatTimedelta (timedelta duration) |
| | Format a timedelta for display.
|
| |
| int | toSecondOfDay (time dayTime) |
| | Get the second from the day for this time.
|
| |
| int | toRoundedSecond (time dayTime) |
| | Get the second from the day for this time and round it.
|
| |
| int | compare (time firstTime, time secondTime) |
| | Compare two times.
|
| |
◆ compare()
| int shift_utils.ShiftUtils.compare |
( |
time | firstTime, |
|
|
time | secondTime ) |
|
static |
Compare two times.
- Parameters
-
| firstTime | First time to compare |
| secondTime | Second time to compare |
- Returns
- -1 if less than, 0 if equal and 1 if greater than
◆ formatTimedelta()
| str shift_utils.ShiftUtils.formatTimedelta |
( |
timedelta | duration | ) |
|
|
static |
Format a timedelta for display.
- Parameters
-
- Returns
- days : hours : minutes : seconds
◆ toEpochDay()
| int shift_utils.ShiftUtils.toEpochDay |
( |
date | day | ) |
|
|
static |
Get the day from the Epoch for this date.
- Parameters
-
- Returns
- days since Epoch
◆ toEpochSecond()
| int shift_utils.ShiftUtils.toEpochSecond |
( |
datetime | instant | ) |
|
|
static |
Get the second from the Epoch for this datetime.
- Parameters
-
| instant | Date and time of day |
- Returns
- seconds since Epoch
◆ toRoundedSecond()
| int shift_utils.ShiftUtils.toRoundedSecond |
( |
time | dayTime | ) |
|
|
static |
Get the second from the day for this time and round it.
- Parameters
-
- Returns
- rounded seconds of day
◆ toSecondOfDay()
| int shift_utils.ShiftUtils.toSecondOfDay |
( |
time | dayTime | ) |
|
|
static |
Get the second from the day for this time.
- Parameters
-
- Returns
- seconds of day
The documentation for this class was generated from the following file: