default func parse

This commit is contained in:
Daniel Tsvetkov 2020-04-26 16:51:52 +02:00
parent b2d161a0e6
commit 99e17d1e9c

View File

@ -38,6 +38,12 @@ DEFAULT_FORMAT = '%Y-%m-%d %H:%M:%S%z'
basepath = os.path.dirname(os.path.abspath(__file__))
def parse_to_iso(dt):
parsed_dt = dateparser.parse(dt)
if parsed_dt:
return parsed_dt.strftime(ISO_FORMAT)
class Location(object):
"""
Represents a location with name, latitude and longitude