Question
I found that
SpreadSheetPlugin makes an error while calculating the number of seconds between 03 Nov 2008 and 02 Nov 2008. - It gives an answer of 90000 instead of 86400
Number of seconds between 02 Oct 2008 and 01 Oct 2008 = %CALC{"$EVAL($TIME(02 Oct 2008) - $TIME(01 Oct 2008))"}% = 86400
Number of seconds between 03 Oct 2008 and 02 Oct 2008 = %CALC{"$EVAL($TIME(03 Oct 2008) - $TIME(02 Oct 2008))"}% = 86400
Number of seconds between 02 Nov 2008 and 01 Nov 2008 = %CALC{"$EVAL($TIME(02 Nov 2008) - $TIME(01 Nov 2008))"}% = 86400
Number of seconds between 03 Nov 2008 and 02 Nov 2008 = %CALC{"$EVAL($TIME(03 Nov 2008) - $TIME(02 Nov 2008))"}% =
90000
Number of seconds between 04 Nov 2008 and 03 Nov 2008 = %CALC{"$EVAL($TIME(04 Nov 2008) - $TIME(03 Nov 2008))"}% = 86400
Funnily, this doesn't happen on my test Twiki installation on my laptop (WinXP)
What could be the reason ? Is this a bug ?
Environment
--
ChengappaCB - 24 Nov 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
This looks like a bug to me. It's unlikely the $EVAL, although you could manually check the difference to find out. I suspect $TIME, which calls the Perl function
timelocal() to convert from display time to serial time. You can test that:
my $t2 = timelocal(0, 0, 0, 2, 10, 2008);
my $t3 = timelocal(0, 0, 0, 3, 10, 2008);
print $t3 - $t2;
The difference is 3600, e.g. exactly one hour. This could point to a daylight savings change, but your example is Nov, e.g. not a time for change.
I'd check with Perl.
--
PeterThoeny - 24 Nov 2008
November 2nd was indeed the day for Daylight savings in 2008, so 90000 seconds is the correct amount of time
--
TimHeilig - 24 Nov 2008
Glad it worked out!
--
PeterThoeny - 25 Nov 2008