nrel.hive.util.time_helpers

Module Contents

Functions

time_in_range(start, end, x)

Return true if x is in the range [start, end).

read_time_string(→ datetime.time)

parses a string in HH:MM:SS format into a datetime.time object

time_diff(→ datetime.timedelta)

finds the time delta between two times. result has date line transitions removed.

nrel.hive.util.time_helpers.time_in_range(start, end, x)[source]

Return true if x is in the range [start, end). adapted from https://stackoverflow.com/a/10748024 with end-exclusive matching added

nrel.hive.util.time_helpers.read_time_string(input_string: str) datetime.time[source]

parses a string in HH:MM:SS format into a datetime.time object

Parameters:

input_string – the input string

Returns:

the time parsed, or, an error

nrel.hive.util.time_helpers.time_diff(start: datetime.time, end: datetime.time) datetime.timedelta[source]

finds the time delta between two times. result has date line transitions removed.

Parameters:
  • start – the start time

  • end – the end time

Returns:

the time between the start event and the finish event, in hours/minutes/seconds