Date (datetime objects) manipulation methods
loyverse.utils.dates.
add_timezone
Localize a datetime object
date (datetime) – date + time to be localized
timezone_id (str) – timezone identifier to be used for localizing date (e.g. Europe/Zurich). For a list of available identifiers, check the tz database.
localized datetime object
date_local (datetime)
utc_isoformat
Format datetime object using the ISO8601 format to UTC timezone
date (datetime) – date + time to be converted into ISO8601 format
timezone_id (str) –
timezone identifier to be used for conversion to UTC time (e.g. Europe/Zurich). For a list of available identifiers, check the tz database.
date + time converted to UTC timezone and ISO format (e.g. 2020-10-12T23:14:59.897Z)
date_str (str)
day_start
Calculates day start for passed in date object
date (datetime) – datetime object, for which to calculate the start of the day
timestamp for start of the given date
date_start (datetime)
day_end
Calculates end of date
date (datetime) – datetime object, for which to calculate the end of the day
timestamp for end of the given date
date_end (datetime)