[R] system time is 5 hours off in Windows

Setzer.Woodrow@epamail.epa.gov Setzer.Woodrow at epamail.epa.gov
Mon Jan 22 18:48:59 CET 2001


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list