From edd at debian.org  Sun Jan 11 17:03:28 2004
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun Jan 11 17:01:48 2004
Subject: [Rd] strange behaviour when converting from char to POSIX
	(PR#6422)
In-Reply-To: <20040109170127.E216710474@slim.kubism.ku.dk>
References: <20040109170127.E216710474@slim.kubism.ku.dk>
Message-ID: <20040111160328.GA30834@sonny.eddelbuettel.com>

On Fri, Jan 09, 2004 at 06:01:27PM +0100, christoph.schmutz@meteoschweiz.ch wrote:
> Full_Name: Christoph Schmutz, MeteoSchweiz, Switzerland
> Version: R1.7.1, R1.8.1
> OS: windows2000, solaris sunOS 5.8
> Submission from: (NULL) (141.249.133.6)
> 
> 
> 
> I'm not sure if I don't get the clue, but please consider this:
> > strptime("19930870150","%Y%j%H%M")
> [1] "1993-03-28 01:50:00"
> > strptime("19930870250","%Y%j%H%M")
> [1] "1993-03-28 01:50:00"
> > strptime("19930870350","%Y%j%H%M")
> [1] "1993-03-28 03:50:00"

You are presumably hitting the switch from dayligh-saving to regular time in
that year.

I was just mucking about with that, but R (1.9.0 as of Jan 8, 2004, on
Debian unstable) still crashes reliably even when I explicitly set the TZ
variable (and it also crashed for TZ=GMT):

> Sys.getenv("TZ")
TZ
""
> Sys.putenv("TZ"="CDT6CST")
> Sys.getenv("TZ")
       TZ
"CDT6CST"
> format(strptime("199308070150","%Y%m%d%H%M"), "%Y-%m-%d %H:%M:%S",
tz="GMT", usetz=TRUE)
[1] "1993-08-07 01:50:00"
> format(strptime("199308070150","%Y%m%d%H%M"), "%Y-%m-%d %H:%M:%S %Z",
tz="GMT", usetz=TRUE)
Segmentation fault


Not nice. I wrote some code to transfer time stamps from one time zone to
another, but that sits at work right now and I can't get to it...

Dirk

> 
> The behaviour is the same with R1.7.1 on Window2000 as on a R1.8.1 on sunOS
> 5.8.
> 
> Thanks for the reply, Christoph
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 

-- 
Bush behaved in Cabinet meetings "like a blind man in roomful of deaf people".
  -- former Treasury secretary Paul O'Neill, quoted by Bloomberg on 9 Jan 2004


[Rd] strange behaviour when converting from char to POSIX (PR#6422)
Dirk Eddelbuettel