foo=> SET TIMEZONE TO 'Japan';
SET
foo=> SELECT '2011-01-01 00:00:00'::TIMESTAMP;
timestamp
---------------------
2011-01-01 00:00:00
(1 row)
foo=> SELECT '2011-01-01 00:00:00'::TIMESTAMP WITH TIME ZONE;
timestamptz
------------------------
2011-01-01 00:00:00+09
(1 row)
foo=> SELECT '2011-01-01 00:00:00+03'::TIMESTAMP;
timestamp
---------------------
2011-01-01 00:00:00
(1 row)
foo=> SELECT '2011-01-01 00:00:00+03'::TIMESTAMP WITH TIME ZONE;
timestamptz
------------------------
2011-01-01 06:00:00+09
(1 row)
foo=> SET TIMEZONE TO 'Australia/Melbourne';
SET
foo=> SELECT '2011-01-01 00:00:00'::TIMESTAMP;
timestamp
---------------------
2011-01-01 00:00:00
(1 row)
foo=> SELECT '2011-01-01 00:00:00'::TIMESTAMP WITH TIME ZONE;
timestamptz
------------------------
2011-01-01 00:00:00+11
(1 row)
foo=> SELECT '2011-01-01 00:00:00+03'::TIMESTAMP;
timestamp
---------------------
2011-01-01 00:00:00
(1 row)
foo=> SELECT '2011-01-01 00:00:00+03'::TIMESTAMP WITH TIME ZONE;
timestamptz
------------------------
2011-01-01 08:00:00+11
(1 row)
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())
)
Code Example |
---|
:: |
:: |
:: |
:: |
:: |
:: alter column set not null to null postgres |
:: |
:: |
:: |
:: |
Sql :: |
Sql :: |
:: |
:: |
:: |
:: |
:: |
:: |
:: |
:: services.AddDbContext DataSource Sqlite |
:: |
:: |
:: |
:: |
Sql :: |
Sql :: |
Sql :: |
:: |
:: |
:: |