Python Datetime.now In Cygwin Console Is Incorrect
If you could help me understand why: From Cygwin terminal: This is correct: $ date Wed, Sep 2, 2020 11:19:07 PM This is also correct: $ date --utc Wed, Sep 2, 2020 9:19:14 PM
Solution 1:
you are using Windows Python and not Cygwin one.
The cygwin one matches with the rest of Cygwin programs
$ python3
Python 3.8.3 (default, May 23 2020, 15:50:53)
[GCC 9.3.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> datetime.now()
datetime.datetime(2020, 9, 2, 23, 45, 26, 525415)
>>> quit()
$ date
Wed, Sep 2, 2020 11:45:40 PM
Post a Comment for "Python Datetime.now In Cygwin Console Is Incorrect"