operations
get_ts(tz=DEFAULT_TZ, as_str=False, str_fmt=TIME_FMT_24H, safe_str=False, char_replace_map=TS_STR_REPLACE_MAP)
Return a pendulum.DateTime object of the current time. Optionally
return timestamp as a string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tz |
str
|
Unix timezone string, defaults to |
DEFAULT_TZ
|
as_str |
bool
|
If |
False
|
str_fmt |
str
|
String that defines the format of the timestamp if |
TIME_FMT_24H
|
safe_str |
bool
|
If |
False
|
char_replace_map |
list[dict]
|
A list of dicts defining characters to search for and replace
in the timestamp str.
Example replace map: |
TS_STR_REPLACE_MAP
|
Returns
(pendulum.DateTime): A `pendulum.DateTime` object of the current time
(str): If `as_str=True`, returns a string representation of the `pendulum.DateTime` timestamp, formatted by `str_fmt`