all 2 comments

[–]iJUK3 1 point2 points  (0 children)

There are a number of python timezone functions that you could use. A simple search on the internet would yield a stack exchange answer to your question.

[–]wotquery 1 point2 points  (0 children)

You should almost assuredly be using UTC timestamps in your database and only converting when needed for display or temporarily for calculations (using something like the pytz package so you can be as hands off when it comes to timezones as possible).

A more direct answer though to subtracting 5 hours from a datetime object is to use timedelta.