-3

Has anyone converted this kind of times before?

2020-10-12T01:00:00-07:00 to 2020-10-12T09:00:00-07:00

equals

Monday, October 12, 2020 at 10:00 AM – 6:00 PM UTC+02

to datetime objects?

10
  • It doesn't no T09:00:00-07:00 how to read after T? Commented Oct 15, 2020 at 9:13
  • Does this answer your question? Converting string into datetime Commented Oct 15, 2020 at 9:13
  • docs.python.org/3/library/… Commented Oct 15, 2020 at 9:15
  • 1
    Do some research and show us something that you tried and didn't work Commented Oct 15, 2020 at 9:15
  • 2
    Those "kind of times" are called "ISO8601" times, and they are standardized. Please do some reading on ISO8601 first, and afterwards you should easily find libraries that can handle ISO8601 times. Commented Oct 15, 2020 at 9:19

1 Answer 1

1

2020-10-12T01:00:00-07:00
<--date--> <-time-><zone>

This means 1am on October 12th, 2020, in the time zone 7 hours west of UTC (running through the middle of the US, basically).

It's actually one of the ISO8601 formats, used for date/time data interchange.

I believe the dateutil.parser() library can handle this in Python.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.