diff --git a/tww/tww.py b/tww/tww.py index 4bee5c5..5bd9e03 100644 --- a/tww/tww.py +++ b/tww/tww.py @@ -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