view roundup/anypy/datetime_.py @ 8309:81ca7ceb71db

build: issue2551397: remove support for python 3.6 Try CI build on python 3.7. If this fails go to python 3.8 build.
author John Rouillard <rouilj@ieee.org>
date Sun, 11 May 2025 17:13:31 -0400
parents d5d7ecd31864
children
line wrap: on
line source

# https://issues.roundup-tracker.org/issue2551278
# datetime.utcnow deprecated
try:
    from datetime import UTC, datetime

    def utcnow():
        return datetime.now(UTC)

except ImportError:
    from datetime import datetime

    def utcnow():
        return datetime.utcnow()

Roundup Issue Tracker: http://roundup-tracker.org/