PipeDream 452/07 Year bug

8 views
Skip to first unread message

David Pitt

unread,
Dec 16, 2014, 3:25:01 AM12/16/14
to colton-softw...@googlegroups.com
There appears to be a date bug in PipeDream 4.52/07.

These functions, date(year(today),1,1) and date(2014,1,1), both return 31
Dec 2013. It is a this year only sort of thing, date(2013,1,1) and
date(2015,1,1) both return correct results, the latter for the next two
weeks only perhaps.

PipeDream 450.23 and Fireworkz 1.35/03 are OK.

An example file is at :-

http://www.pittdj.co.uk/temp/PD4Year.zip

--
David Pitt

Gerald Fitton

unread,
Dec 16, 2014, 5:28:51 AM12/16/14
to colton-softw...@googlegroups.com
I can confirm this.

Also date arithmetic fails so that, as an example, date(2014,12,32) returns the 2nd January 2014 instead of the 1st January 2014.

Also (perhaps a clue here) date(2000,12,33) is needed in order to return 1st January 2001.

Has the Millennium bug reappeared?

Gerald

Stuart Swales

unread,
Dec 18, 2014, 10:47:48 AM12/18/14
to colton-softw...@googlegroups.com
> --
> You received this message because you are subscribed to the Google
> Groups "Colton Software PipeDream" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to colton-software-pi...@googlegroups.com
> <mailto:colton-software-pi...@googlegroups.com>.
> To post to this group, send email to
> colton-softw...@googlegroups.com
> <mailto:colton-softw...@googlegroups.com>.
> Visit this group at
> http://groups.google.com/group/colton-software-pipedream.
> For more options, visit https://groups.google.com/d/optout.

Indeed. The date handling code in both PipeDream and Fireworkz has
always been somewhat suspect even though RJM and MRJC both maintained
otherwise. I just never managed to get a enough time to sit down before
and stare at the code for long enough to figure out exactly why. Fixes
in one area always seemed to expose other corner cases and gaping holes.

As it happens I'd been re-examining this area in Fireworkz (for Excel
saving, which needs a consistent serial number generating to represent
dates) so had a better idea of what was going on there. Too many
confusing zero-based and one-based differences.

So I have changed the internal programming interfaces so that year,
month, day are always presented to/from the date value conversion code
as natural, one-based numbers (0001..9999,1..12,1..31) and added
checking code in Debug builds to verify that conversions can
successfully be reversed. I then found the bugs quite quickly and
squished them. Particularly horrid was the one relating to 31.12.2000
(and all other multiples of 400).

Please give the new build (on croftnuisk.co.uk/coltsoft/pipedream) a whirl!

Season's Greetings from all at East Croftnuisk!
--
Stuart Swales

David Pitt

unread,
Dec 18, 2014, 12:25:50 PM12/18/14
to colton-softw...@googlegroups.com
Stuart Swales, on 18 Dec, wrote:

[snip]
> > On Tuesday, 16 December 2014 08:25:01 UTC, pittdj wrote:
> >
> > There appears to be a date bug in PipeDream 4.52/07.
> >
> > These functions, date(year(today),1,1) and date(2014,1,1), both
> > return 31 Dec 2013.

[snip]

> So I have changed the internal programming interfaces so that year, month,
> day are always presented to/from the date value conversion code as
> natural, one-based numbers (0001..9999,1..12,1..31) and added checking
> code in Debug builds to verify that conversions can successfully be
> reversed. I then found the bugs quite quickly and squished them.
> Particularly horrid was the one relating to 31.12.2000 (and all other
> multiples of 400).
>
> Please give the new build (on croftnuisk.co.uk/coltsoft/pipedream) a
> whirl!

Many thanks, that is fine with the issue I discovered.

> Season's Greetings from all at East Croftnuisk!

And well deserved Season's Greetings from to all at East Croftnuisk.
--
David Pitt
Reply all
Reply to author
Forward
0 new messages