s-news
[Top] [All Lists]

bug in timeAlign in S-PLUS 7.0

To: S-news <s-news@lists.biostat.wustl.edu>
Subject: bug in timeAlign in S-PLUS 7.0
From: Tony Plate <tplate@blackmesacapital.com>
Date: Fri, 16 Sep 2005 09:13:41 -0600
User-agent: Mozilla Thunderbird 1.0.5 (Windows/20050711)
I noticed that timeAlign() seems broken in S-PLUS 7.0: when given dir=-1, it aligns some days that are the 31st of a month to the next day. S-PLUS 6.X does not have this problem.

E.g.:

> d <- timeDate("08/31/2000", format="%Y/%02m/%02d %02H:%02M:%02S %z", in.format="[%m[/][.]%d[/][,]%y] [%H[:%M[:%S[.%N]]][%p][[(]%3Z[)]]]", zone="GMT")
> # Wrong behavior in S-PLUS 7.0
> version
Enterprise Developer Version 7.0.3  for Microsoft Windows : 2005
> d
[1] 2000/08/31 00:00:00 GMT
> timeAlign(d, by="days", dir=-1)
[1] 2000/09/01 00:00:00 GMT
> q()

> # Correct behavior in S-PLUS 6.2
> version
Professional Edition Version 6.2.1  for Microsoft Windows : 2003
> d
[1] 2000/08/31 00:00:00 GMT
> timeAlign(d, by="days", dir=-1)
[1] 2000/08/31 00:00:00 GMT


The timeAlign function has changed from 6.2.1 to 7.0, and I found that using the old timeAlign function from 6.2.1 seems to work ok in 7.0 and give correct answers in these cases.

AFAICS, this behavior happens for all days that are the 31st of the month, except for July 31st and Dec 31st.

So, I was wondering if anyone had any insights on the following:

(1) is using the old timeAlign function in 7.0 going to be OK, or are there other functions in 7.0 that depend on some aspects of the new (buggy) timeAlign function?

(2) does anyone know of any other bugs introduced in timeDate handling in 7.0?

-- Tony Plate

PS: in case anyone was wondering, I did submit a report on this to Insightful (some time ago) but I have not heard any response from them.

<Prev in Thread] Current Thread [Next in Thread>