X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fsfatime.py;fp=sfa%2Futil%2Fsfatime.py;h=aab0663575b38e90ef965893bfc92f5f8b480721;hb=04acd3228e5911d36d0cd58dc35b9319fc558e17;hp=6793ad57e6c91b3af9b56d0a308fb0675dde60c3;hpb=e5537b113b6fe5874fdcd5b12414568500aa106c;p=sfa.git diff --git a/sfa/util/sfatime.py b/sfa/util/sfatime.py index 6793ad57..aab06635 100644 --- a/sfa/util/sfatime.py +++ b/sfa/util/sfatime.py @@ -29,7 +29,6 @@ import calendar import re from sfa.util.sfalogging import logger -from sfa.util.py23 import StringType SFATIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" @@ -59,7 +58,7 @@ For safety this can also handle inputs that are either timestamps, or datetimes # prepare the input for the checks below by # casting strings ('1327098335') to ints - if isinstance(input, StringType): + if isinstance(input, str): try: input = int(input) except ValueError: @@ -75,7 +74,7 @@ For safety this can also handle inputs that are either timestamps, or datetimes if isinstance(input, datetime.datetime): #logger.info ("argument to utcparse already a datetime - doing nothing") return input - elif isinstance(input, StringType): + elif isinstance(input, str): t = dateutil.parser.parse(input) if t.utcoffset() is not None: t = t.utcoffset() + t.replace(tzinfo=None)