WSL/SLF GitLab Repository

Commit 05f94034 authored by Rebecca Kurup Buchholz's avatar Rebecca Kurup Buchholz
Browse files

Added function to return unix timestamp in UTC timezone

parent 7de8b287
......@@ -12,6 +12,12 @@ def get_utc_datetime(date_string, date_format):
return dt_object
# Return unix timestamp (assumes date_string is in UTC timezone)
def get_unix_timestamp(date_string, date_format):
dt_object = get_utc_datetime(date_string, date_format)
return int(datetime.timestamp(dt_object.replace(tzinfo=timezone.utc)))
# Returns year from date string
def get_year(date_string):
return date_parser.parse(date_string).year
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment