Subject: Re: bug#7337: 23.2; (require 'time) changes timezone

From: Kevin Ryde <[email-masked]>
Date: Thu, 18 Nov 2010 11:16:41 +1100

I wrote:
> lisp `getenv' ... TZ

Perhaps it should effectively be a save-and-restore of getenv TZ, since
setenv TZ does the set-time-zone-rule (in emacs22 up).

    (let ((old (getenv "TZ")))
      (setenv "TZ" new)
      (unwind-protect
        (...)
        (setenv "TZ" old)))

Which would still lose any set-time-zone-rule that had not been
accompanied by a (setenv "TZ").  But if you've got TZ in the C environ[]
and lisp process-environment out of sync then there's probably going to
be trouble no matter what.