diff options
Diffstat (limited to 'pyasn1/type/useful.py')
-rw-r--r-- | pyasn1/type/useful.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pyasn1/type/useful.py b/pyasn1/type/useful.py index 7536b95..a9a0287 100644 --- a/pyasn1/type/useful.py +++ b/pyasn1/type/useful.py @@ -7,8 +7,6 @@ import datetime from pyasn1 import error -from pyasn1.compat import dateandtime -from pyasn1.compat import string from pyasn1.type import char from pyasn1.type import tag from pyasn1.type import univ @@ -74,9 +72,9 @@ class TimeMixIn(object): elif '-' in text or '+' in text: if '+' in text: - text, plusminus, tz = string.partition(text, '+') + text, plusminus, tz = text.partition('+') else: - text, plusminus, tz = string.partition(text, '-') + text, plusminus, tz = text.partition('-') if self._shortTZ and len(tz) == 2: tz += '00' @@ -99,9 +97,9 @@ class TimeMixIn(object): if '.' in text or ',' in text: if '.' in text: - text, _, ms = string.partition(text, '.') + text, _, ms = text.partition('.') else: - text, _, ms = string.partition(text, ',') + text, _, ms = text.partition(',') try: ms = int(ms) * 1000 @@ -118,7 +116,7 @@ class TimeMixIn(object): text += '00' try: - dt = dateandtime.strptime(text, self._yearsDigits == 4 and '%Y%m%d%H%M%S' or '%y%m%d%H%M%S') + dt = datetime.datetime.strptime(text, self._yearsDigits == 4 and '%Y%m%d%H%M%S' or '%y%m%d%H%M%S') except ValueError: raise error.PyAsn1Error('malformed datetime format %s' % self) |