Open allardhoeve opened 5 years ago
You can simply substitute existing sqlalchemy.sql.functions.now
with sqlalchemy_utc.now.utcnow
, e.g.:
from sqlalchemy_utc.now import utcnow
article = Article(title='…', content='…', published_at=utcnow())
You can also use them as server defaults: sa.Column('timestamp', sa.DateTime(True), server_default=utcnow())
The functions in
now.py
look great! But I have no idea how to use them properly. Can you provide a snippet where you actually use them? Thanks!