pandas.Timestamp

class pandas.Timestamp

TimeStamp is the pandas equivalent of python’s Datetime and is interchangable with it in most cases. It’s the type used for the entries that make up a DatetimeIndex, and other timeseries oriented data structures in pandas.

There are essentially three calling conventions for the constructor. The primary form accepts four parameters. They can be passed by position or keyword.

Parameters:

ts_input : datetime-like, str, int, float

Value to be converted to Timestamp

freq : str, DateOffset

Offset which Timestamp will have

tz : string, pytz.timezone, dateutil.tz.tzfile or None

Time zone for time which Timestamp will have.

unit : string

numpy unit used for conversion, if ts_input is int or float

offset : str, DateOffset

Deprecated, use freq

The other two forms mimic the parameters from ``datetime.datetime``. They

can be passed by either position or keyword, but not both mixed together.

Attributes

asm8
day
dayofweek
dayofyear
days_in_month
daysinmonth
fold
freq
freqstr
hour
is_leap_year
is_month_end
is_month_start
is_quarter_end
is_quarter_start
is_year_end
is_year_start
microsecond
minute
month
nanosecond
offset
quarter
second
tz Alias for tzinfo
tzinfo
value
week
weekday_name
weekofyear
year

Methods

astimezone Convert tz-aware Timestamp to another time zone.
ceil return a new Timestamp ceiled to this resolution
combine
ctime Return ctime() style string.
date Return date object with same year, month and day.
dst Return self.tzinfo.dst(self).
floor return a new Timestamp floored to this resolution
fromordinal passed an ordinal, translate and convert to a ts
fromtimestamp
isocalendar Return a 3-tuple containing ISO year, week number, and weekday.
isoformat
isoweekday Return the day of the week represented by the date.
normalize Normalize Timestamp to midnight, preserving tz information.
now Return the current time in the local timezone.
replace implements datetime.replace, handles nanoseconds
round Round the Timestamp to the specified resolution
strftime format -> strftime() style string.
strptime string, format -> new datetime parsed from a string (like time.strptime()).
time Return time object with same time but with tzinfo=None.
timestamp Return POSIX timestamp as float.
timetuple Return time tuple, compatible with time.localtime().
timetz Return time object with same time and tzinfo.
to_datetime DEPRECATED: use to_pydatetime() instead.
to_datetime64 Returns a numpy.datetime64 object with ‘ns’ precision
to_julian_date Convert TimeStamp to a Julian Date.
to_period Return an period of which this timestamp is an observation.
to_pydatetime Convert a Timestamp object to a native Python datetime object.
today Return the current time in the local timezone.
toordinal Return proleptic Gregorian ordinal.
tz_convert Convert tz-aware Timestamp to another time zone.
tz_localize Convert naive Timestamp to local time zone, or remove timezone from tz-aware Timestamp.
tzname Return self.tzinfo.tzname(self).
utcfromtimestamp
utcnow
utcoffset Return self.tzinfo.utcoffset(self).
utctimetuple Return UTC time tuple, compatible with time.localtime().
weekday Return the day of the week represented by the date.
Scroll To Top