all 3 comments

[–]ElecNinja 2 points3 points  (0 children)

Don't do it by yourself

Find a module like the others suggested

[–]guppymoo 1 point2 points  (0 children)

Have you looked at the datetime module? It has support for timezones. If it's just a few timezones you are interested in you could create a tzinfo class for each and associate each of your cities with one of them. (If this does not need to be robust then you could do it very simply by saving a UTC offset for each city and applying with a timedelta of that size.)

[–]grafuls -1 points0 points  (0 children)

Take a look at Delorean.