Ashish SHUKLA wrote: > I did this in X11 window (note the absence > of '-batch' option) > > --8<---------------cut here---------------start------------->8--- > emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -Q -eval '(progn (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' > oldtz=(null) tz=XXX-0:00:00 oldTZ=(null) TZ=(null) 2015-02-15 06:42:44 -1 -> 2015-02-15 06:42:44 0 = 1423962764 This makes it look like immediately after set_time_zone_rule ("XXX-0:00:00") was called, getenv ("TZ") returned NULL. That shouldn't happen: set_time_zone_rule is supposed to arrange for TZ to have the specified value. Could you please try similar tests with the attached patch instead? It should tell us whether set_time_zone_rule is properly affecting the TZ environment variable.