A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrow.apache.org/docs/python/api/../generated/pyarrow.timestamp.html below:

pyarrow.timestamp — Apache Arrow v21.0.0

pyarrow.timestamp#
pyarrow.timestamp(unit, tz=None)#

Create instance of timestamp type with resolution and optional time zone.

Parameters:
unitstr

one of ‘s’ [second], ‘ms’ [millisecond], ‘us’ [microsecond], or ‘ns’ [nanosecond]

tzstr, default None

Time zone name. None indicates time zone naive

Returns:
timestamp_typeTimestampType

Examples

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'>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4