time
get_timestamp(only_int=True)
¶
Returns a timestamp as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_int |
bool
|
if True, the timestamp is returned as an integer. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the timestamp as a string. |
Examples:
>>> from spotpython.utils.time import get_timestamp
>>> get_timestamp()
'2021-06-28 14:51:54.500000'
>>> get_timestamp(only_int=True)
'20210628145154500000'
Source code in spotpython/utils/time.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|