Have ever you confusing when converting the timezone on python. So, in this post, I will describe a simple way to understand and using timezone converting. We have two steps to conversion DateTime from a timezone to another timezone.
1. Determined current timezone. from datetime import datetime
fdate = datetime.now() For the above code, the fdate variable will be assign timezone of local. I’m in Singapore fdate is in Singapore UTC+8.