0

I have converted datetime to "Europe/Paris" format.

datetime
2016-07-15 8:32:02

df['datetime']=df['datetime'].dt.tz_localize("Europe/Paris")

Output:
2016-07-15 8:32:02+02:00

I want to remove +02:00 from this datetime and I am expecting to have the following

2016-07-15 10:32:02

Can someone help me?

Prasad
  • 175
  • 1
  • 2
  • 9
  • It looks like all `.dt.tz_localize("Europe/Paris")` is doing is to add the `+2:00`. Why not just remove it? – Mad Physicist Nov 11 '16 at 15:06
  • I want to convert the time to `Europe/Paris` using `.dt.tz_localize("Europe/Paris")` and at the same time I don't want `+2:00` – Prasad Nov 11 '16 at 15:10
  • I'm not sure what you expect is correct, if you do `df['datetime'].dt.tz_convert(None)` you get `2016-07-15 06:32:02` not `2016-07-15 10:32:02` – EdChum Nov 11 '16 at 15:10
  • If you'd localised the datetimes to GMT first and then converted then you get the following: `In [85]: df['datetime'].dt.tz_localize("GMT").dt.tz_convert("Europe/Paris") Out[85]: 0 2016-07-15 10:32:02+02:00` – EdChum Nov 11 '16 at 15:14
  • 1
    Possible duplicate of [Convert pandas timezone-aware DateTimeIndex to naive timestamp, but in certain timezone](http://stackoverflow.com/questions/16628819/convert-pandas-timezone-aware-datetimeindex-to-naive-timestamp-but-in-certain-t) – sangrey Nov 11 '16 at 15:14
  • Check out [this](https://github.com/StamKaly/ip-to-local-time/blob/master/get/localt.py#L7). It might help if you are using `pytz`, otherwise, start using it :P – Stam Kaly Nov 11 '16 at 15:27
  • When I import this date variable to Tableau, it is treating it as a string variable. if I can add two hours to `datetime` variable without `+02:00` might solve the issue. – Prasad Nov 14 '16 at 20:36

0 Answers0