Dealing with time zone calculations

One of the trickiest calculations that you will have to perform on date or time objects is the one that involves time zones. Your colleague works in San Francisco and you are in Sydney, how do you plan to do a conference call? When you set up a meeting, you should be aware of your colleague's time zone, else you may set up a meeting for 8 pm Sydney time while for your colleague in San Francisco, it is already past midnight. Time zone calculations are often tedious and need to be handled cautiously while developing business applications. Let's see how Python can help us in this regard.

Getting ready

For this recipe, we will use the pytz module that we installed at the beginning of this chapter. In fact, the Python ...

Get Automate it! - Recipes to upskill your business now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.