TReK Python  5.3.3
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  -> def  -> def ) -> def 
 Class initializer. More...
 
Get Time

Functions to return time.

def __str__ ( -> str  -> def  -> def ) -> def 
 Returns get_time_string(), fractional, not file friendly.
 
def get_delta_time ( TrekTime delta_from -> float  -> def  -> def ) -> def 
 Gets the difference between two times. More...
 
def get_time ( -> tuple[int, int]  -> def  -> def ) -> def 
 Gets the time relative the system epoch. More...
 
def get_time_components ( -> TrekTimeComponents  -> def  -> def ) -> def 
 Gets the complete time value in components. More...
 
def get_time_float ( -> float  -> def  -> def ) -> def 
 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  -> def  -> def ) -> def 
 Gets the time as string. More...
 
def get_seconds ( -> int  -> def  -> def ) -> def 
 Returns the current number of seconds since the epoch. More...
 
def get_subseconds ( -> int  -> def  -> def ) -> def 
 Returns the current number of seconds since the epoch. More...
 
def get_subseconds_per_second ( -> int  -> def  -> def ) -> def 
 Returns the current number of subseconds per second. More...
 
Set Time

Functions to set time.

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

(trek_time : Optional[TrekTime]