eta.util.time.TimePoint
- class TimePoint(time=None)[source]
Bases:
object
A specific point in time.
- Parameters:
time (datetime, tuple[datetime, datetime], list[str], or None) –
Initialize with a given datetime, or otherwise use the current time. The following formats are supported:
datetime : a single instantaneous timestamp.
(datetime, datetime) : lower and upper bound timestamps for this time point.
[$, date+time, <year>, <month>, <day>, <hour>, <minute>, <second>] : a date+time record structure, where each slot may be either a number string or a variable string.
None : the time point will be initialized to the current time.
- lower
A timestamp for the lower bound on this timepoint.
- Type:
datetime
- upper
A timestamp for the upper bound on this timepoint.
- Type:
datetime
Methods
copy
Format this TimePoint as a year/month/day/hour/minute/second representation.
Format this TimePoint as a human-readable year/month/day/hour/minute/second representation.
get_duration
Convert this TimePoint to a numerical POSIX representation (using the upper bound by default).
Convert this TimePoint to a ULF record structure.
Update this TimePoint to the given time (or current if none is given).
- to_num(bound='upper')[source]
Convert this TimePoint to a numerical POSIX representation (using the upper bound by default).