I want to find my local time zone and then return the time zone name (cet, est etc.) using Python and my location so that I can just find it without entering any additional information except for the location of my pc (which I want to find using GPS and not manually adding it)
import say
import datetime
def timezone():
timezone = datetime.datetime.now()
timezonename = timezone.strftime("%Z")
timezoneoffset = timezone.strftime("%z")
say.praten(f"the timezone is {timezonename} which is {timezoneoffset} off UTC")
I used this but this doesn't return anything with the datetime import the say command is from a different file for text to speech
everyone is revering me to this post : Get system local timezone in python but I tried this and I got the full name of the time zone (Europe Berlin) but I want the 3 letter name (cet in my case)