def set_process_timezone(TZ):
try:<EOL><INDENT>prev_timezone = os.environ['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>prev_timezone = None<EOL><DEDENT>os.environ['<STR_LIT>'] = TZ<EOL>time.tzset()  <EOL>return prev_timezone<EOL>
Parameters
----------
TZ: string