getml.data.time
Convenience functions for the handling of time stamps.
In getML, time stamps are always expressed as a floating point value. This float measures the number of seconds since UNIX time (January 1, 1970, 00:00:00). Smaller units of time are expressed as fractions of a second.
To make this a bit easier to handle, this module contains simple convenience functions that express other time units in terms of seconds.
seconds
Returns the number of seconds.
PARAMETER | DESCRIPTION |
---|---|
num | The number of seconds. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num |
Source code in getml/data/time.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
minutes
Expresses num minutes in terms of seconds.
PARAMETER | DESCRIPTION |
---|---|
num | The number of minutes. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num minutes expressed in terms of seconds. |
Source code in getml/data/time.py
40 41 42 43 44 45 46 47 48 49 50 51 |
|
hours
Expresses num hours in terms of seconds.
PARAMETER | DESCRIPTION |
---|---|
num | The number of hours. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num hours expressed in terms of seconds. |
Source code in getml/data/time.py
57 58 59 60 61 62 63 64 65 66 67 68 |
|
days
Expresses num days in terms of seconds.
PARAMETER | DESCRIPTION |
---|---|
num | The number of days. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num days expressed in terms of seconds. |
Source code in getml/data/time.py
74 75 76 77 78 79 80 81 82 83 84 85 |
|
weeks
Expresses num weeks in terms of seconds.
PARAMETER | DESCRIPTION |
---|---|
num | The number of weeks. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num weeks expressed in terms of seconds. |
Source code in getml/data/time.py
91 92 93 94 95 96 97 98 99 100 101 102 |
|
milliseconds
Expresses num milliseconds in terms of fractions of a second.
PARAMETER | DESCRIPTION |
---|---|
num | The number of milliseconds. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num milliseconds expressed in terms of seconds. |
Source code in getml/data/time.py
108 109 110 111 112 113 114 115 116 117 118 119 |
|
microseconds
Expresses num microseconds in terms of fractions of a second.
PARAMETER | DESCRIPTION |
---|---|
num | The number of microseconds. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | num microseconds expressed in terms of seconds. |
Source code in getml/data/time.py
125 126 127 128 129 130 131 132 133 134 135 136 |
|
datetime
datetime(
year: int,
month: int,
day: int,
hour: int = 0,
minute: int = 0,
second: int = 0,
microsecond: int = 0,
) -> float
Returns the number of seconds since UNIX time (January 1, 1970, 00:00:00).
PARAMETER | DESCRIPTION |
---|---|
year | Year component of the date. TYPE: |
month | Month component of the date. TYPE: |
day | Day component of the date. TYPE: |
hour | Hour component of the date. TYPE: |
minute | Minute component of the date. TYPE: |
second | Second component of the date. TYPE: |
microsecond | Microsecond component of the date. TYPE: |
RETURNS | DESCRIPTION |
---|---|
float | The number of seconds since UNIX time (January 1, 1970, 00:00:00). |
Source code in getml/data/time.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|