Warning
This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
Source code for galaxy.model.orm.now
from datetime import (
datetime,
timezone,
)
# NOTE REGARDING TIMESTAMPS:
# It is currently difficult to have the timestamps calculated by the
# database in a portable way, so we're doing it in the client. This
# also saves us from needing to postfetch on postgres. HOWEVER: it
# relies on the client's clock being set correctly, so if clustering
# web servers, use a time server to ensure synchronization
[docs]
def now():
"""
Return the current time in UTC without any timezone information.
"""
return datetime.now(timezone.utc).replace(tzinfo=None)
__all__ = ("now",)