phenome_core.util.time_functions module

current_milli_time()
floor_datetime(dt=None)

Round a datetime object to base minute If no datetime is specified, now() will be used.

get_period_milliseconds(period_type)
get_rows_per_period_and_frequency(period, frequency)
get_timeout_expired(considered_time, timeout_delay)
get_total_minutes_seconds_from_clock_time(clock_time)

Takes a string like HH:MM:SS and returns minutes, seconds since

get_total_minutes_seconds_from_timestamp(timestamp)

Takes a unix timestamp, compares to NOW, and returns minutes, seconds since

round_datetime(dt=None, round_to=60)

Round a datetime object to any time lapse in seconds dt : datetime.datetime object, default now. round_to : Closest number of seconds to round to, default 1 minute. Author: Thierry Husson 2012 - Use it as you want but don’t blame me.