emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.50; on Windows, M-x display-time-world shows the same, incorrec


From: Eli Zaretskii
Subject: Re: 23.0.50; on Windows, M-x display-time-world shows the same, incorrect, time for all cities
Date: Sat, 20 Oct 2007 16:19:35 +0200

> Date: Thu, 18 Oct 2007 00:46:21 +0100
> From: Jason Rumney <address@hidden>
> Cc: Eric Hanchrow <address@hidden>, address@hidden,
>       Ivan Kanis <address@hidden>
> 
> there appear to be multiple problems beyond just the timezone
> name, including the fact that standard libraries on Windows only read
> the TZ environment variable on startup

I don't see on my system that TZ is only read on startup.  The
attached simple test program demonstrates that TZ can be changed
during the program's run with expected results, at least on my XP SP2
box.

So it looks like just by fixing display-time-world-list we could make
this work on Windows as well.

Am I missing something?


------------------------------ cut here -------------------------
#include <time.h>
#include <stdlib.h>
#include <stdio.h>

int main (int argc, char *argv[])
{
   char tstr[1024];
   time_t t;

   t = time (NULL);
   strftime (tstr, sizeof (tstr), "%c %z", localtime (&t));
   printf ("%s\n", tstr);
   if (_putenv ("TZ=EST5EDT") != -1)
   {
      _tzset ();
      strftime (tstr, sizeof (tstr), "%c %z", localtime (&t));
      printf ("%s\n", tstr);
   }
   if (_putenv ("TZ=PST8PDT") != -1)
   {
      _tzset ();
      strftime (tstr, sizeof (tstr), "%c %z", localtime (&t));
      printf ("%s\n", tstr);
   }
   return 0;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]