Closed
Description
pd.to_datetime('now')
returns the current UTC time, while pd.Timestamp('now')
returns the current local time. pd.to_datetime('today')
rounds the current UTC time down to midnight, while pd.Timestamp('today')
returns the current local time (not rounded down). These should be fixed to follow a single convention.
>>> pd.Timestamp('now')
Timestamp('2017-12-09 12:28:31.642416')
>>> pd.to_datetime('now')
Timestamp('2017-12-09 20:28:35')
>>> pd.Timestamp('today')
Timestamp('2017-12-09 12:28:49.263407')
>>> pd.to_datetime('today')
Timestamp('2017-12-09 00:00:00')
AFAICT the to_datetime behavior was designed to match the behavior of np.datetime64('now')
and np.datetime64('today')
. The Timestamp behavior matches the special constructors Timestamp.now()
, Timestamp.today()
. At this point I think the least disruptive change would be to make Timestamp(...) behave like to_datetime(...).
Thoughts?