Date arithmetic oddity
Bill Weale (5/8/14 3:19PM)
Jeremy Roussak (5/9/14 8:37AM)
Bill Weale (5/8/14 3:19 PM)
System settings: Metric dates?
8-|
On May 8, 2014, at 2:51 PM, Jeremy Roussak wrote:
color><param>00000,0000,DDEE/param>IIs this the correct result? And if
so, why?
C_DATE($start;$end)
C_REAL($interval)
$start:=!00/00/0000!
$end:=Current date// it's the 8th of May 2014
$interval:=($end-$start)/365.25
ALERT(String($end;System date long)+"\r"+String($interval))
shows
Thursday, 8 May 2014
2015.1485
/color>
Jeremy Roussak (5/9/14 8:37 AM)
Nice try, Ortwin - but you've not noticed that the year in the
difference is wrong (2015 not 2014). The answer's not out by 54-127
(-73 days); it's out by +292 days.
The change from Julian to Gregorian calendar involved an 11-day leap
in England, by the way.
So, again - what's going on? Is this a bug?
Jeremy
Jeremy Roussak
jbr@...
On 8 May 2014, at 21:04, Ortwin Zillgen <info@... wrote:
color><param>8826F,0000,8219/param>CC_DATE($start;$end)
C_REAL($interval)
$start:=!00/00/0000!
$end:=Current date// it's the 8th of May 2014
$interval:=($end-$start)/365.25
ALERT(String($end;System date long)+"\r"+String($interval))
shows
Thursday, 8 May 2014
2015.1485
/color><color><param>00000,0000,DDEE/param>
$end-$start = 736 033 days
0.1485 of a year equals some 54,25 days
Mai 8th is day 127 of the year
how comes the difference 127-54,25=72,75
1582+ 10 days, because of change from the julian to the
gregorian
calender
365,25+ 15 days, because 365,25 days a year is 11 minutes to short,
which adds up to 1 day every 130 years
still some 50 days missing
/color>
Reply to this message
Summary created 5/9/14 at 4:40AM by Intellex Corporation
Comments welcome at: feedback@intellexcorp.com