|
| def | _elapsed_time_to_string (elapsed) |
| |
| def | _elapsed_time_to_string_without_millis (elapsed) |
| |
| def | _float_secs_to_secs_and_millis (secs) |
| |
| def | _get_dst_difference (time1, time2) |
| |
| def | _get_timetuple (epoch_secs=None) |
| |
| def | _normalize_timestamp (ts, seps) |
| |
| def | _normalize_timestr (timestr) |
| |
| def | _number_to_secs (number) |
| |
| def | _parse_time_epoch (timestr) |
| |
| def | _parse_time_now_and_utc (timestr) |
| |
| def | _parse_time_now_and_utc_base (base) |
| |
| def | _parse_time_now_and_utc_extra (extra) |
| |
| def | _parse_time_timestamp (timestr) |
| |
| def | _split_timestamp (timestamp) |
| |
| def | _time_string_to_secs (timestr) |
| |
| def | _timer_to_secs (number) |
| |
| def | _timestamp_to_millis (timestamp, seps=None) |
| |
| def | elapsed_time_to_string (elapsed, include_millis=True) |
| | Converts elapsed time in milliseconds to format 'hh:mm:ss.mil'. More...
|
| |
| def | format_time (timetuple_or_epochsecs, daysep='', daytimesep=' ', timesep=':', millissep=None) |
| | Returns a timestamp formatted from given time using separators. More...
|
| |
| def | get_elapsed_time (start_time, end_time) |
| | Returns the time between given timestamps in milliseconds. More...
|
| |
| def | get_time (format='timestamp', time_=None) |
| | Return the given or current time in requested format. More...
|
| |
| def | get_timestamp (daysep='', daytimesep=' ', timesep=':', millissep='.') |
| |
| def | parse_time (timestr) |
| | Parses the time string and returns its value as seconds since epoch. More...
|
| |
| def | secs_to_timestamp (secs, seps=None, millis=False) |
| |
| def | secs_to_timestr (secs, compact=False) |
| | Converts time in seconds to a string representation. More...
|
| |
| def | timestamp_to_secs (timestamp, seps=None) |
| |
| def | timestr_to_secs (timestr, round_to=3, accept_plain_values=True) |
| | Parses time strings like '1h 10s', '01:00:10' and '42' and returns seconds. More...
|
| |
| def robot.utils.robottime.format_time |
( |
|
timetuple_or_epochsecs, |
|
|
|
daysep = '', |
|
|
|
daytimesep = ' ', |
|
|
|
timesep = ':', |
|
|
|
millissep = None |
|
) |
| |
Returns a timestamp formatted from given time using separators.
Time can be given either as a timetuple or seconds after epoch.
Timetuple is (year, month, day, hour, min, sec[, millis]), where parts must
be integers and millis is required only when millissep is not None.
Notice that this is not 100% compatible with standard Python timetuples
which do not have millis.
Seconds after epoch can be either an integer or a float.
Definition at line 207 of file robottime.py.
| def robot.utils.robottime.get_time |
( |
|
format = 'timestamp', |
|
|
|
time_ = None |
|
) |
| |
Return the given or current time in requested format.
If time is not given, current time is used. How time is returned is
determined based on the given 'format' string as follows. Note that all
checks are case-insensitive.
- If 'format' contains word 'epoch' the time is returned in seconds after
the unix epoch.
- If 'format' contains any of the words 'year', 'month', 'day', 'hour',
'min' or 'sec' only selected parts are returned. The order of the returned
parts is always the one in previous sentence and order of words in
'format' is not significant. Parts are returned as zero padded strings
(e.g. May -> '05').
- Otherwise (and by default) the time is returned as a timestamp string in
format '2006-02-24 15:08:31'
Definition at line 236 of file robottime.py.
| def robot.utils.robottime.parse_time |
( |
|
timestr | ) |
|
Parses the time string and returns its value as seconds since epoch.
Time can be given in five different formats:
1) Numbers are interpreted as time since epoch directly. It is possible to
use also ints and floats, not only strings containing numbers.
2) Valid timestamp ('YYYY-MM-DD hh:mm:ss' and 'YYYYMMDD hhmmss').
3) 'NOW' (case-insensitive) is the current local time.
4) 'UTC' (case-insensitive) is the current time in UTC.
5) Format 'NOW - 1 day' or 'UTC + 1 hour 30 min' is the current local/UTC
time plus/minus the time specified with the time string.
Seconds are rounded down to avoid getting times in the future.
Definition at line 271 of file robottime.py.
| def robot.utils.robottime.secs_to_timestr |
( |
|
secs, |
|
|
|
compact = False |
|
) |
| |
Converts time in seconds to a string representation.
Returned string is in format like
'1 day 2 hours 3 minutes 4 seconds 5 milliseconds' with following rules:
- Time parts having zero value are not included (e.g. '3 minutes 4 seconds'
instead of '0 days 0 hours 3 minutes 4 seconds')
- Hour part has a maximun of 23 and minutes and seconds both have 59
(e.g. '1 minute 40 seconds' instead of '100 seconds')
If compact has value 'True', short suffixes are used.
(e.g. 1d 2h 3min 4s 5ms)
Definition at line 151 of file robottime.py.
| def robot.utils.robottime.timestr_to_secs |
( |
|
timestr, |
|
|
|
round_to = 3, |
|
|
|
accept_plain_values = True |
|
) |
| |
Parses time strings like '1h 10s', '01:00:10' and '42' and returns seconds.
Time can also be given as an integer or float or, starting from RF 6.0.1,
as a `timedelta` instance.
The result is rounded according to the `round_to` argument.
Use `round_to=None` to disable rounding altogether.
`accept_plain_values` is considered deprecated and should not be used.
Definition at line 55 of file robottime.py.