Get time zone information of the system in Python?

This should work:

import time
time.tzname

time.tzname returns a tuple of two strings: The first is the name of the local non-DST timezone, the second is the name of the local DST timezone.

Example return: ('MST', 'MDT')

Leave a Comment