How to compare time in different time zones in Python?
Answers
Answered by
0
Tutorialspoint
Search your favorite tutorials...
How to compare time in different time zones in Python?
How do I compare time in different time zones in Python?
Follow Answer 522
1 Answer
Rajendra Dharmkar
Rajendra Dharmkar
Answered on 8th Jan, 2018
When you have 2 different time objects with different timezones and you need to compare them, you first need to understand the difference between aware and naive objects. An aware datetime object is an object that holds the information about the timezone while naive object doesn't hold any timezone information.
The easiest way to compare 2 aware objects to check whether they tell the same time or not is to directly compare them.
Similar questions
English,
7 months ago
English,
7 months ago
Computer Science,
1 year ago
Physics,
1 year ago
Biology,
1 year ago