Skip to content

Commit d1e3e1b

Browse files
committed
ENH: tighter Timestamp repr, close #1391
1 parent 422869f commit d1e3e1b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/src/datetime.pyx

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class Timestamp(_Timestamp):
102102

103103
return ts_base
104104

105+
def __repr__(self):
106+
result = self.strftime('<Timestamp: %Y-%m-%d %H:%M:%S%z')
107+
if self.tzinfo:
108+
result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
109+
return result + '>'
110+
105111
@property
106112
def tz(self):
107113
"""

0 commit comments

Comments
 (0)