Skip to content

Instantly share code, notes, and snippets.

@svelleweetakealot
Created September 6, 2017 10:44
Show Gist options
  • Save svelleweetakealot/4e8df353b0db2207c2b5c53b16375b6d to your computer and use it in GitHub Desktop.
Save svelleweetakealot/4e8df353b0db2207c2b5c53b16375b6d to your computer and use it in GitHub Desktop.
Reasons to Python3
  • Datetime
> python3 -c 'import datetime;  print(datetime.datetime(1895, 10, 6, 16, 4, 5).strftime("%Y-%m-%d %H:%M:%S"))'
1895-10-06 16:04:05
> python2 -c 'import datetime;  print(datetime.datetime(1895, 10, 6, 16, 4, 5).strftime("%Y-%m-%d %H:%M:%S"))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ValueError: year=1895 is before 1900; the datetime strftime() methods require year >= 1900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment