postgresql query timestamp with timezone code example
Example 1: postgres set timezone
SET TIME ZONE 'Europe/Moscow';
Example 2: postgresql date at timezone
select updatedat AT TIME ZONE 'UTC';
Example 3: sqlalchemy postgres timestamp with timezone
from sqlalchemy import Column, DateTime, Integer, MetaData, Table
from sqlalchemy.sql import func
metadata = MetaData()
example = Table('example', metadata,
Column('id', Integer, primary_key=True),
Column('date', DateTime(timezone=True), default=func.now())
)