| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/../generated/../generated/pyarrow.timestamp.html | [Back] [Original] |
Section Navigation
Create instance of timestamp type with resolution and optional time zone.
TimestampTypeExamples
Create an instance of timestamp type:
>>> import pyarrow as pa
>>> pa.timestamp('us')
TimestampType(timestamp[us])
>>> pa.timestamp('s', tz='America/New_York')
TimestampType(timestamp[s, tz=America/New_York])
>>> pa.timestamp('s', tz='+07:30')
TimestampType(timestamp[s, tz=+07:30])
Use timestamp type when creating a scalar object:
>>> from datetime import datetime
>>> pa.scalar(datetime(2012, 1, 1), type=pa.timestamp('s', tz='UTC'))
<pyarrow.TimestampScalar: '2012-01-01T00:00:00+0000'>
>>> pa.scalar(datetime(2012, 1, 1), type=pa.timestamp('us'))
<pyarrow.TimestampScalar: '2012-01-01T00:00:00.000000'>
Copyright 2016-2026 Apache Software Foundation.
Apache Arrow, Arrow, Apache, the Apache logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Created using Sphinx 9.1.0.
Built with the PyData Sphinx Theme 0.20.0.
| Web Proxy Viewer | New URL | Original Page |