Setzer.Woodrow@epamail.epa.gov
2001-Jan-19 21:49 UTC
[R] system time is 5 hours off in Windows
Am I missing a configuration step? The value returned by date() and Sys.time() is five hours later than the system time. Furthermore, Sys.timezone() returns Eastern Daylight Time, whereas we are really currently in Eastern Standard Time. I am running: _ platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 2.1 year 2001 month 01 day 15 language R R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 19 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote:> Am I missing a configuration step? The value returned by date() and > Sys.time() is five hours later than the system time. Furthermore,That I have not seen. Entirely possible, given Windows bugs. I am really sick of having to correct their mistakes in standard C library functions in this area.> Sys.timezone() returns Eastern Daylight Time, whereas we are really > currently in Eastern Standard Time. I am running:That''s what Windows calls the time zone. It means it has the possibility of DST, I think.> > _ > platform i386-pc-mingw32 > arch x86 > os Win32 > system x86, Win32 > status > major 1 > minor 2.1 > year 2001 > month 01 > day 15 > language R > > > R. Woodrow Setzer, Jr. Phone: > (919) 541-0128 > Experimental Toxicology Division Fax: (919) 541-5394 > Pharmacokinetics Branch > NHEERL MD-74; US EPA; RTP, NC 27711 > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Setzer.Woodrow@epamail.epa.gov
2001-Jan-22 15:42 UTC
[R] system time is 5 hours off in Windows
I thought of the dual boot problem, but this is not a dual boot machine. In any case, at least in earlier versions of Linux and Win 95, the problem is that Windows wants to take the system clock literally as local time. At least the Red Hat distribution allows you to tell it the time zone for the system clock. It does look like this is a problem with my setup, though, since no one else has reported a similar problem. Thanks. R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 Prof Brian D Ripley To: Woodrow Setzer/RTP/USEPA/US at EPA <ripley at stats cc: .ox.ac.uk> Subject: Re: [R] system time is 5 hours off in Windows Sent by: ripley at auk.st ats 01/19/2001 06:44 PM On Fri, 19 Jan 2001, Prof Brian D Ripley wrote:> On Fri, 19 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote: > > > Am I missing a configuration step? The value returned by date() and > > Sys.time() is five hours later than the system time. Furthermore, > > That I have not seen. Entirely possible, given Windows bugs. I am really > sick of having to correct their mistakes in standard C library functions > in this area.To confirm, if I set my NT4 computer to that time zone, it reports Eastern Daylight Time as the time zone (rather than GB Daylight Time) but Windows and R do agree on the time. Looks like a peculiarity of your setup. If it were common I would be suprised that it had not been reported before. (Some people are all to keen to report non-bugs.) I seem to remember there are issues on PCs about running clocks on UTC or local time that surface if they are dualbootable (Windows/Linux). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Setzer.Woodrow@epamail.epa.gov
2001-Jan-22 15:49 UTC
[R] system time is 5 hours off in Windows
Sorry to take up more bandwidth on a relatively minor point, but, under R-1.1.1, date() returns the system time, whereas under R-1.2.0 and R-1.2.1, date() returns system time + 5 hours (as if it were really returning UTC). Does msvcrt.dll handle the date-time functions? Maybe I''ve got a problem there. R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 Prof Brian D Ripley To: Woodrow Setzer/RTP/USEPA/US at EPA <ripley at stats cc: .ox.ac.uk> Subject: Re: [R] system time is 5 hours off in Windows Sent by: ripley at auk.st ats 01/19/2001 06:44 PM On Fri, 19 Jan 2001, Prof Brian D Ripley wrote:> On Fri, 19 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote: > > > Am I missing a configuration step? The value returned by date() and > > Sys.time() is five hours later than the system time. Furthermore, > > That I have not seen. Entirely possible, given Windows bugs. I am really > sick of having to correct their mistakes in standard C library functions > in this area.To confirm, if I set my NT4 computer to that time zone, it reports Eastern Daylight Time as the time zone (rather than GB Daylight Time) but Windows and R do agree on the time. Looks like a peculiarity of your setup. If it were common I would be suprised that it had not been reported before. (Some people are all to keen to report non-bugs.) I seem to remember there are issues on PCs about running clocks on UTC or local time that surface if they are dualbootable (Windows/Linux). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Setzer.Woodrow@epamail.epa.gov
2001-Jan-22 17:48 UTC
[R] system time is 5 hours off in Windows
Curiouser and curiouser ... I rewrote the function R_date (do_date is just a wrapper around R_date) slightly to make it a standalone program (here i did not replace the trailing ''\n'' with ''\0'', and printed out the result): #include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> int main(void) { time_t t; char s[26]; time(&t); strcpy(s, ctime(&t)); printf("%s\n",s); return(0); } The result is [gcc is i386-mingw32msvc-gcc.exe from the gcc-2.95.2-1 mingw distribution ]: D:\home\setzer\newstuff\tmp>gcc -o testtime testtime.c D:\home\setzer\newstuff\tmp>testtime Mon Jan 22 12:31:17 2001 D:\home\setzer\newstuff\tmp>time Current time is 12:31:27.89p Enter new time: A little later, in R-1.2.1:> date()[1] "Mon Jan 22 17:32:24 2001">R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 Woodrow Setzer/RTP/USEPA/US@ To: r-help at lists.R-project.org EPA cc: Sent by: Subject: [R] system time is 5 hours off in Windows owner-r-help at stat.ma th.ethz.ch 01/19/2001 04:49 PM Am I missing a configuration step? The value returned by date() and Sys.time() is five hours later than the system time. Furthermore, Sys.timezone() returns Eastern Daylight Time, whereas we are really currently in Eastern Standard Time. I am running: _ platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 2.1 year 2001 month 01 day 15 language R R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 22 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote:> Curiouser and curiouser ... > > I rewrote the function R_date (do_date is just a wrapper around R_date) > slightly to make it a standalone program (here i did not replace the > trailing ''\n'' with ''\0'', and printed out the result): >Since you are in time zone -5 (according to your mail headers) it looks as if you may well have a configuration problem. It appears that for some reason you are getting UTC rather than your local time. I have seen this happen under Linux: there''s a choice of whether the real time clock should run local time or should run UTC and have the system apply the time zone correction. I don''t know anything about the Windows situation, though. -thomas Thomas Lumley Asst. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Setzer.Woodrow@epamail.epa.gov
2001-Jan-22 23:14 UTC
[R] system time is 5 hours off in Windows
If I set TZ in the environment to something reasonable (I''ve used TZ=EST+5 and TZ="EST+5EDT,M4.1.0/2,M10.5.0/2"), R gives correct answers for the current time, and returns a reasonable timezone string for Sys.time(): D:\home\setzer>set TZ=EST+5EDT,M4.1.0/2,M10.5.0/2 D:\home\setzer>echo %TZ% EST+5EDT,M4.1.0/2,M10.5.0/2 D:\home\setzer>Rterm R : Copyright 2001, The R Development Core Team Version 1.2.1 (2001-01-15) [...] [Previously saved workspace restored]> date()[1] "Mon Jan 22 17:46:11 2001"> Sys.time()[1] "2001-01-22 17:46:16 EST"> Sys.timezone()[1] "EST+5EDT,M4.1.0/2,M10.5.0/2"> q("no")D:\home\setzer>time Current time is 5:47:15.76p If I unset TZ, then the timezone reported in R doesn''t make sense, really. D:\home\setzer>set TZ D:\home\setzer>echo %TZ% ECHO is on D:\home\setzer>Rterm [...]> Sys.time()[1] "2001-01-22 22:49:49 Eas"> Sys.timezone()[1] "Eastern Daylight Time" So now the time returned is UTC. When I was experimenting with setting the timezone, I inadvertantly included double quotes in the TZ string. When I asked for Sys.time(), the timezone part of the resulting string was \"Ea, so the string being reported is just being copied unconditionally into the output string. I''ve found the warning in the documentation for as.POSIXct to try setting TZ on UNIX-like systems if the POSIX functions give unusual results; perhaps this should apply to Windows systems, too? That doesn''t explain the return of date() which relies on the OS to set the time zone (and, when I execute the same code as a stand-alone program, I get the correct system time). It is as if some startup code looks for TZ in the environment, and if it is not there, sets it to a value which, perhaps, the system does not recognize as valid, and defaults to GMT. This is what I get inside Rgui when I query the TZ variable (I have not set it in the environment):> Sys.getenv("TZ")TZ "Eastern Daylight Time" It seems to me that, if this is going to be used to set the time zone for POSIX functions, it should look like one of the standard ways of specifying a time zone (all I know about this is what I read in the libc manual about the POSIX date-time functions, so I may be way off base here for the Windows implementation). R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 Woodrow Setzer/RTP/USEPA/US@ To: r-help at lists.R-project.org EPA cc: Sent by: Subject: [R] system time is 5 hours off in Windows owner-r-help at stat.ma th.ethz.ch 01/19/2001 04:49 PM Am I missing a configuration step? The value returned by date() and Sys.time() is five hours later than the system time. Furthermore, Sys.timezone() returns Eastern Daylight Time, whereas we are really currently in Eastern Standard Time. I am running: _ platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 2.1 year 2001 month 01 day 15 language R R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 22 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote: [...]> I''ve found the warning in the documentation for as.POSIXct to try setting > TZ on UNIX-like systems if the POSIX functions give unusual results; > perhaps this should apply to Windows systems, too? That doesn''t explainIt seems OK everywhere else, whic is why it is not mentioned there.> the return of date() which relies on the OS to set the time zone (and, when > I execute the same code as a stand-alone program, I get the correct system > time). It is as if some startup code looks for TZ in the environment, and > if it is not there, sets it to a value which, perhaps, the system does not > recognize as valid, and defaults to GMT.Windows code does not use TZ according to its documentation.> This is what I get inside Rgui when I query the TZ variable (I have not set > it in the environment): > > > Sys.getenv("TZ") > TZ > "Eastern Daylight Time"R sets it for its own purposes.> It seems to me that, if this is going to be used to set the time zone for > POSIX functions, it should look like one of the standard ways of specifying > a time zone (all I know about this is what I read in the libc manual about > the POSIX date-time functions, so I may be way off base here for the > Windows implementation).Right. It is not documented and does not in general work for Windows. We do it by hand on Windows. It is possible that what we do (using tzname and tzset()) is upsetting date(), which I have no idea how it works, -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
As discussed in another thread, the date() function returns the current date and time (possibly in the wrong time zone on Windows). What I''m interested in getting is a value that I can do calculations with, to support animations. That is, I''d like to get the current time, do a display, do some calculations, then get the current time again and calculate the update to the display based on the time difference. Do I have to write my own external function, or is this already available somewhere? (I could parse date(), but that will only give me 1 second resolution; I think the system clock will do better on most systems.) (I know about system.time(), but I don''t think it''s quite appropriate: I don''t just want to know how long the first display calculation took, I need to know the time at the start of the next one. I''m worried that there will be slippage if I use system.time().) Duncan Murdoch -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
dmurdoch at pair.com (Duncan Murdoch) writes:> As discussed in another thread, the date() function returns the > current date and time (possibly in the wrong time zone on Windows). > What I''m interested in getting is a value that I can do calculations > with, to support animations. That is, I''d like to get the current > time, do a display, do some calculations, then get the current time > again and calculate the update to the display based on the time > difference. > > Do I have to write my own external function, or is this already > available somewhere? (I could parse date(), but that will only give > me 1 second resolution; I think the system clock will do better on > most systems.) > > (I know about system.time(), but I don''t think it''s quite appropriate: > I don''t just want to know how long the first display calculation took, > I need to know the time at the start of the next one. I''m worried > that there will be slippage if I use system.time().)Just to complete the discussion on date parsing, unclass(as.POSIXct(strptime(date(),"%c"))) or as.POSIXct(strptime(date(),"%c")) - structure(0,class="POSIXct") gives the time in seconds since the beginning of time() (generally Jan 1 1970 0:00:00 GMT on Unixen). However, I think proc.time()[3] is more relevant for your needs. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /''_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Setzer.Woodrow@epamail.epa.gov
2001-Jan-23 15:09 UTC
[R] system time is 5 hours off in Windows
I think I understand what is happening with my system time problem (though not why, exactly). The problem is not in R, but, apparently, in an interaction between my version of msvcrt.dll (version 6.10.8637.0) and the implementations of the POSIX time functions in mingw32. At the end of this message is a little c program and batch file that demonstrate the problem. This is the result of a run on my machine: A:\>ttime A:\>echo off TZtzname[0] tzname[1] Before tzset(): PST PDT After tzset(): Eastern Standard Time Eastern Daylight Time Tue Jan 23 09:51:42 2001 TZ=Eastern Standard Time tzname[0] tzname[1] Before tzset(): PST PDT After tzset(): Eas ter Tue Jan 23 14:51:42 2001 TZ=EST+5 tzname[0] tzname[1] Before tzset(): PST PDT After tzset(): EST Tue Jan 23 09:51:43 2001 A:\> So, initially, TZ is not set, the value of tzname defaults to PST PDT (home time zone of Redmond!), and after calling tzset(), tzname has reasonable sounding values (though not exactly POSIXly correct). The functions time() and ctime() report the correct value. Set TZ to the value of tzname[0], and now, after calling tzset(), tzname[0] is "Eas" and tzname[1] is "ter", and the time reported is local time plus 5 hours (UTC time?). If I set TZ to a value sanctioned by the libc documentation for the POSIX time functions, tzname[0] is reasonable, and again I get the correct time. The problem seems to be that setting TZ to a value returned by tzname is not guaranteed to result in a correct conversion to local time, at least with my setup. I''ve tried this on two pcs running Win95, and in all cases the correct time is returned. From Dr. Ripley''s comment about a lack of bug reports about this, I''d have to conclude that most Win98 versions work as well ----------------------------- testtime.c: #include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> int main(void) { time_t t; printf("tzname[0] tzname[1]\n"); printf("Before tzset(): %s %s\n",tzname[0],tzname[1]); tzset(); printf("After tzset(): %s %s\n",tzname[0],tzname[1]); time(&t); printf("%s",ctime(&t)); return(0); } ttime.bat: echo off set TZecho TZ=%TZ% testtime.exe set TZ=Eastern Standard Time echo TZ=%TZ% testtime.exe set TZ=EST+5 echo TZ=%TZ% testtime.exe R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 23 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote:> > I think I understand what is happening with my system time problem (though > not why, exactly). The problem is not in R, but, apparently, in an > interaction between my version of msvcrt.dll (version 6.10.8637.0) and the > implementations of the POSIX time functions in mingw32. At the end of this > message is a little c program and batch file that demonstrate the problem.No problem on my NT4 laptop (no surprise) nor on my Win98 Vaio mini-notebook (which has msvcrt.dll version 6.00.8397.0). Do you have Win98SE? I am looking for a workaround .... Writing the original datetime code on Solaris was easy. I read the docs, programmed it up, it worked. Then I tried Linux, and spent longer wroking arounds its bugs. Then I tried Windows, and spent as long again working around its bugs .... Since release several more bugs have emerged under various OSes. I now wish I had ignored the OS altogether, but writing time-zone handling is a *very* messy task. Brian -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Setzer.Woodrow@epamail.epa.gov
2001-Jan-24 14:03 UTC
[R] system time is 5 hours off in Windows
Brian, Look, your time is valuable (to yourself and the rest of the R community). It is not difficult to set TZ in the environment to a POSIX acceptable value, and it should not be so difficult to add some documentation to the effect that, if date() gives wrong answers, TZ needs to be set on Windows. It looks like this problem will not effect very many people. By the way, no I do not have Win98SE. Our IT people offered to upgrade me, but so far, this is the only problem I''ve encountered (other than the usual rebooting once a day or so, which I expect to always have to do when running Windows 9x and descendents), and, "if it ain''t broke, don''t fix it". Thanks for your efforts. R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 Prof Brian Ripley To: Woodrow Setzer/RTP/USEPA/US at EPA <ripley at stats cc: r-help at hypatia.math.ethz.ch .ox.ac.uk> Subject: Re: [R] system time is 5 hours off in Windows 01/24/2001 07:34 AM On Tue, 23 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote:> > I think I understand what is happening with my system time problem(though> not why, exactly). The problem is not in R, but, apparently, in an > interaction between my version of msvcrt.dll (version 6.10.8637.0) andthe> implementations of the POSIX time functions in mingw32. At the end ofthis> message is a little c program and batch file that demonstrate theproblem. No problem on my NT4 laptop (no surprise) nor on my Win98 Vaio mini-notebook (which has msvcrt.dll version 6.00.8397.0). Do you have Win98SE? I am looking for a workaround .... Writing the original datetime code on Solaris was easy. I read the docs, programmed it up, it worked. Then I tried Linux, and spent longer wroking arounds its bugs. Then I tried Windows, and spent as long again working around its bugs .... Since release several more bugs have emerged under various OSes. I now wish I had ignored the OS altogether, but writing time-zone handling is a *very* messy task. Brian -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 24 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote:> > Brian, > Look, your time is valuable (to yourself and the rest of the R community).But it was easy to fix this. What I had not noticed is that Windows has a non-standard putenv too, so if I just remove the Win32-specific code it unsets TZ and works too. (I just needed to change the way Sys.timesone works.) And that should work slightly better for everyone. The changes will be in the pre-release of rw1022 tomorrow, if you would like to take a look then: http://www.stats.ox.ac.uk/pub/bdr/RWin/Rpre/ Brian> It is not difficult to set TZ in the environment to a POSIX acceptable > value, and it should not be so difficult to add some documentation to the > effect that, if date() gives wrong answers, TZ needs to be set on Windows. > It looks like this problem will not effect very many people. > By the way, no I do not have Win98SE. Our IT people offered to upgrade me, > but so far, this is the only problem I''ve encountered (other than the usual > rebooting once a day or so, which I expect to always have to do when > running Windows 9x and descendents), and, "if it ain''t broke, don''t fix > it". Thanks for your efforts. > > R. Woodrow Setzer, Jr. Phone: > (919) 541-0128 > Experimental Toxicology Division Fax: (919) 541-5394 > Pharmacokinetics Branch > NHEERL MD-74; US EPA; RTP, NC 27711 > > > > Prof Brian > Ripley To: Woodrow Setzer/RTP/USEPA/US at EPA > <ripley at stats cc: r-help at hypatia.math.ethz.ch > .ox.ac.uk> Subject: Re: [R] system time is 5 hours off in Windows > > 01/24/2001 > 07:34 AM > > > > > > On Tue, 23 Jan 2001 Setzer.Woodrow at epamail.epa.gov wrote: > > > > > I think I understand what is happening with my system time problem > (though > > not why, exactly). The problem is not in R, but, apparently, in an > > interaction between my version of msvcrt.dll (version 6.10.8637.0) and > the > > implementations of the POSIX time functions in mingw32. At the end of > this > > message is a little c program and batch file that demonstrate the > problem. > > No problem on my NT4 laptop (no surprise) nor on my Win98 Vaio > mini-notebook (which has msvcrt.dll version 6.00.8397.0). Do you have > Win98SE? > > I am looking for a workaround .... > > Writing the original datetime code on Solaris was easy. I read the docs, > programmed it up, it worked. Then I tried Linux, and spent longer wroking > arounds its bugs. Then I tried Windows, and spent as long again > working around its bugs .... Since release several more bugs have > emerged under various OSes. > > I now wish I had ignored the OS altogether, but writing time-zone > handling is a *very* messy task. > > Brian > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272860 (secr) > Oxford OX1 3TG, UK Fax: +44 1865 272595 > > > > > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._