TReK Python  5.3.2
Telemetry/Command API
TrekTime Class Reference

This class holds a time value represented as seconds from the system epoch. More...

Public Member Functions

Initialize / Finalize

Functions handling class initialization and finalization.

def TrekTime ( Optional[TrekTime] trek_time=None, Optional[c_void_p] native_ptr=None) -> def 
 Class initializer. More...
 
Get Time

Functions to return time.

def __str__ () -> str 
 Returns get_time_string(), fractional, not file friendly.
 
def get_delta_time ( TrekTime delta_from) -> float 
 Gets the difference between two times. More...
 
def get_time () -> tuple[int, int] 
 Gets the time relative the system epoch. More...
 
def get_time_components () -> TrekTimeComponents 
 Gets the complete time value in components. More...
 
def get_time_float () -> float 
 Gets time relative the system epoch as a 64-bit floating point. More...
 
def get_time_string (fractional: bool=True, file_friendly: bool=False) -> str 
 Gets the time as string. More...
 
def get_seconds () -> int 
 Returns the current number of seconds since the epoch. More...
 
def get_subseconds () -> int 
 Returns the current number of seconds since the epoch. More...
 
def get_subseconds_per_second () -> int 
 Returns the current number of subseconds per second. More...
 
Set Time

Functions to set time.

def copy ( TrekTime copy_from) -> None 
 Copies the content values of the provided 'copy_from' TrekTime into the callings' TrekTime. More...
 
def shift_time (shift_amount: float) -> None 
 Shifts the time. More...
 
def set_time () -> None 
 Sets the time to the current system time. More...
 
def set_time_by_secs_subs (secs: int, subsecs: int=0) -> None 
 Sets the time relative the system epoch based on the input. More...
 
def set_time_by_string (timestr: str) -> None 
 Sets the time based on the input string. More...
 
def set_time_by_float (time_float: float) -> None 
 Sets the time relative the system epoch based on the input. More...
 
def set_subsec_per_second (subsecsper: int) -> None 
 Set the number of subseconds per second. More...
 

Detailed Description

This class holds a time value represented as seconds from the system epoch.

The time may also have an optional fractional second (subsecond) value. The number of subseconds allowed is enforced by the maximum subseconds per second value. The default number of subseconds per second is 1,000,000 (microseconds).

Note
Windows systems can use this class to represent times until 2100-01-01. However, Linux systems can only represent time until 2038-01-19 03:14:07.

Constructor & Destructor Documentation

◆ TrekTime()

TrekTime (trek_time : Optional[TrekTime]