Posts

Showing posts from 2018

Time and Timezones in Python

Image
Processing of time information is often a critical part in a Python application. In this post, we are going to solve the following problem: Given the departure time and the duration of a flight from New York to London, find the arrival time in London local time. Departure New York: Jul 23 at 19:30, 2018 Flight time: 7h 15min   The final output will be Task: Find the arrival time in London local time. To solve this problem we need to consider time zones. And that can be a challenge. Time zones are not fixed, they change depending on political decisions. For example, during the summer in New York the time zone respected is EDT (Eastern Daylight Time), but during the winter the time zone EST (Eastern Standard Time) is followed. The situation is similar in London, during summer the BST (British Summer Time) is used and in the winter GMT (Greenwich Mean Time) is followed. When does the summer end and the winter start? Well, that’s not based on meteorolo...