0

So I am pulling some Timestamp data from a database, though I'm not sure where the pulling of this data occurs in my code or if any conversion is applied to this data after it is pulled from the database.

What I do know is that when displayed, it looks like this:

2016-01-05T00:00:00

I am not sure what date type this is, but what I am trying to do is to convert it to a date, without the time element.

So I am trying to make it look like this: 2016-01-05

Because of the complicated nature of my code/repositories, I cannot set a breakpoint and print the dtype of this column, or the dataframe for that matter.

Any suggestions on the above?

jikf
  • 25
  • 6

1 Answers1

1

This must be the ISO 8601 format to represent date and time combined.

If you need to work with it, the built-in datetime module has a datetime class that has methods to deal with it:

pandas works quite well with datetime, but it's worth mentioning that pandas equivalent is pandas.Timestamp.

Edit:

I just found out some great answers that you will want to read:

R_D
  • 430
  • 1
  • 7