[R] system time is 5 hours off in Windows

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 24 15:28:08 CET 2001


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



More information about the R-help mailing list