Mailman 3 python.org
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Datetime-SIG June 2022

Start a nNew thread
Download
Threads by month
  • ----- 2023 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
datetime-sig@python.org
  • 1 participants
  • 1 discussions
Trouble to resolve a timezone offset to get correct UTC time
by Pierre 04 Jun '22

04 Jun '22
Hello, I am sorry, I am kind of lost and I would be really grateful to receive some help. Basically, I have a list of timestamps expressed as a strings as below, and I would like them expressed in UTC. But there seems to be a trouble during the offset, which is applied the other way round. The input timestamps look like: 0 'Sat Mar 30 2019 21:00:00 GMT+0100' Adding them in a panda dataframe with to_datetime function, they read then: GC['Time'] = pd.todatetime(my_timestamps) GC['Time'] 0 2019-03-30 21:00:00-01:00 If I further ask: GC['Time'][0] datetime.datetime(2019, 3, 30, 21, 0, tzinfo=tzoffset(None, -3600)) It seems, AFAIK, OK. But then if I want to resolve the offset so as to have time expressed in UTC time, I get: GC['Test'] = pd.to_datetime(GC['Time'],utc=True) 0 2019-03-30 22:00:00+00:00 The offset has bee applied the other way round. Correct timestamp in UTC would be 20:00:00 Please, what should I do to have these timestamps correctly expressed in UTC time? I thank you in advance for your help. I am so sorry to intrude the mailing list with this question, but I am unable to move forward from this point. I thank you again, Bests, Pierre
3 2
0 0

HyperKitty Powered by HyperKitty version 1.3.8b1.