Skip to content
Snippets Groups Projects
Commit a830af5f authored by tomrink's avatar tomrink
Browse files

add another helper time function

parent 346f713d
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,11 @@ def get_time_tuple_utc(timestamp): ...@@ -57,6 +57,11 @@ def get_time_tuple_utc(timestamp):
return dt_obj, dt_obj.timetuple() return dt_obj, dt_obj.timetuple()
def get_datetime_obj(dt_str, format_code='%Y-%m-%d_%H:%M'):
dto = datetime.datetime.strptime(dt_str, format_code).replace(tzinfo=timezone.utc)
return dto
def get_timestamp(dt_str, format_code='%Y-%m-%d_%H:%M'): def get_timestamp(dt_str, format_code='%Y-%m-%d_%H:%M'):
dto = datetime.datetime.strptime(dt_str, format_code).replace(tzinfo=timezone.utc) dto = datetime.datetime.strptime(dt_str, format_code).replace(tzinfo=timezone.utc)
ts = dto.timestamp() ts = dto.timestamp()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment