File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Unreleased
1111- SQLAlchemy DDL: Allow setting ``server_default`` on columns to enable
1212 server-generated defaults.
1313
14- - Allow handling "aware" datetime values with time zone info when inserting or updating.
14+ - Allow handling datetime values tagged with time zone info when inserting or updating.
1515
1616
17172023/04/18 0.31.1
Original file line number Diff line number Diff line change @@ -142,8 +142,9 @@ Refresh locations:
142142Updating Data
143143=============
144144
145- Both when inserting or updating data, values for ``TIMESTAMP `` columns can be obtained
146- in different formats. Both literal strings and datetime objects are supported.
145+ Values for ``TIMESTAMP `` columns can be obtained as a string literal, ``date ``,
146+ or ``datetime `` object. If the datetime object contains timezone information,
147+ it is converted to UTC, and the timezone information is discarded.
147148
148149 >>> import datetime as dt
149150 >>> timestamp_full = " 2023-06-26T09:24:00.123+02:00"
Original file line number Diff line number Diff line change @@ -99,9 +99,10 @@ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#c
9999
100100.. NOTE ::
101101
102- Values of ``TIMESTAMP `` columns will always be stored using a ``LONG `` type,
103- representing the `Unix time `_ (epoch) timestamp, i.e. number of seconds which
104- have passed since 00:00:00 UTC on Thursday, 1 January 1970.
102+ When using ``date `` or ``datetime `` objects with ``timezone `` information,
103+ the value is implicitly converted to a `Unix time `_ (epoch) timestamp, i.e.
104+ the number of seconds which have passed since 00:00:00 UTC on
105+ Thursday, 1 January 1970.
105106
106107 This means, when inserting or updating records using timezone-aware Python
107108 ``datetime `` objects, timezone information will not be preserved. If you
You can’t perform that action at this time.
0 commit comments