Skip to content

Commit 14fd59a

Browse files
committed
Add Timestamp With Offset canonical extension type
1 parent 603901a commit 14fd59a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/source/format/CanonicalExtensions.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,28 @@ binary values look like.
483483

484484
.. _variant_primitive_type_mapping:
485485

486+
Timestamp With Offset
487+
=============
488+
This type represents a timestamp column that stores potentially different timezone offsets per value. The timestamp is stored in UTC alongside the original timezone offset in minutes.
489+
490+
* Extension name: ``arrow.timestamp_with_offset``.
491+
492+
* The storage type of the extension is a ``Struct`` with 2 fields, in order:
493+
494+
* ``timestamp``: a non-nullable ``Timestamp(time_unit, "UTC")``, where ``time_unit`` is any Arrow ``TimeUnit`` (s, ms, us or ns).
495+
496+
* ``offset_minutes``: a non-nullable signed 16-bit integer (``Int16``) representing the offset in minutes from the UTC timezone. Negative offsets represent time zones west of UTC, while positive offsets represent east. Offsets range from -779 (-12:59) to +780 (+13:00).
497+
498+
* Extension type parameters:
499+
500+
* ``time_unit``: the time-unit of each of the stored UTC timestamps.
501+
502+
* Description of the serialization:
503+
504+
Extension metadata is an empty string.
505+
506+
When de/serializing to/from JSON, this type must be represented as an RFC3339 string with timezone offset, respecting the ``TimeUnit`` precision without loss of information. For example ``2025-01-01T00:00:00Z`` represents January 1st 2025 in UTC with second precision, and ``2025-01-01T00:00:00.000000001-07:00`` represents one nanosecond after January 1st 2025 in UTC-07.
507+
486508
Primitive Type Mappings
487509
-----------------------
488510

0 commit comments

Comments
 (0)