I need to know the current time at CDT when my Python script is run. However this script will be run in multiple different timezones so a simple offset won’t work.
I only need a solution for Linux, but a cross platform solution would be ideal.
I need to know the current time at CDT when my Python script is
Share
You can use
time.gmtime()to get time GMT (UTC) from any machine no matter the timezone, then you can apply your offset.