Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dateandtime.py 482B

12345678910111213141516171819202122
  1. #
  2. # This file is part of pyasn1 software.
  3. #
  4. # Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
  5. # License: http://snmplabs.com/pyasn1/license.html
  6. #
  7. import time
  8. from datetime import datetime
  9. from sys import version_info
  10. __all__ = ['strptime']
  11. if version_info[:2] <= (2, 4):
  12. def strptime(text, dateFormat):
  13. return datetime(*(time.strptime(text, dateFormat)[0:6]))
  14. else:
  15. def strptime(text, dateFormat):
  16. return datetime.strptime(text, dateFormat)