1
0
forked from s434650/CatOrNot
CatOrNot/venv/lib/python3.6/site-packages/pyasn1/compat/dateandtime.py
2018-12-11 00:32:28 +01:00

23 lines
482 B
Python

#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import time
from datetime import datetime
from sys import version_info
__all__ = ['strptime']
if version_info[:2] <= (2, 4):
def strptime(text, dateFormat):
return datetime(*(time.strptime(text, dateFormat)[0:6]))
else:
def strptime(text, dateFormat):
return datetime.strptime(text, dateFormat)