pandas.Timestamp.unit — pandas 3.0.0.dev0+2106.gb2b2d04e41 documentation (original) (raw)
Timestamp.unit#
The abbreviation associated with self._creso.
This property returns a string representing the time unit of the Timestamp’s resolution. It corresponds to the smallest time unit that can be represented by this Timestamp object. The possible values are: - ‘s’ (second) - ‘ms’ (millisecond) - ‘us’ (microsecond) - ‘ns’ (nanosecond)
Returns:
str
A string abbreviation of the Timestamp’s resolution unit: - ‘s’ for second - ‘ms’ for millisecond - ‘us’ for microsecond - ‘ns’ for nanosecond
Examples
pd.Timestamp("2020-01-01 12:34:56").unit 's'
pd.Timestamp("2020-01-01 12:34:56.123").unit 'ms'
pd.Timestamp("2020-01-01 12:34:56.123456").unit 'us'
pd.Timestamp("2020-01-01 12:34:56.123456789").unit 'ns'