Open yesthesoup opened 4 years ago
default_sql_now returns CURRENT_TIMESTAMP for psql, but without specifying UTC this returns the server's local time.
default_sql_now
CURRENT_TIMESTAMP
SQLAlchemy docs recommend the following implementation for a psql utc_now():
@compiles(utcnow, 'postgresql') def pg_utcnow(element, compiler, **kw): return "TIMEZONE('utc', CURRENT_TIMESTAMP)"
default_sql_now
returnsCURRENT_TIMESTAMP
for psql, but without specifying UTC this returns the server's local time.SQLAlchemy docs recommend the following implementation for a psql utc_now():