Mercurial > p > roundup > code
comparison roundup/anypy/datetime_.py @ 7692:8fb42f41ef10 issue2550923_computed_property
merge in default branch to see if ti clears a travis-ci build error on 2.7 python; default branch builds fine
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 11 Sep 2023 00:10:29 -0400 |
| parents | 6894f152d49a |
| children | d5d7ecd31864 |
comparison
equal
deleted
inserted
replaced
| 7528:14a8e11f3a87 | 7692:8fb42f41ef10 |
|---|---|
| 1 # https://issues.roundup-tracker.org/issue2551278 | |
| 2 # datetime.utcnow deprecated | |
| 3 try: | |
| 4 from datetime import datetime, UTC | |
| 5 | |
| 6 def utcnow(): | |
| 7 return datetime.now(UTC) | |
| 8 | |
| 9 except ImportError: | |
| 10 from datetime import datetime | |
| 11 | |
| 12 def utcnow(): | |
| 13 return datetime.utcnow() |
