Post Reply 
Deltadays and date functions.
05-10-2017, 03:17 PM
Post: #6
RE: Deltadays and date functions.
(05-10-2017 01:28 PM)Vtile Wrote:  I have been in seach of simple algorithm to calculate dDays between two dates.

The JDN method is too heavy to my use (DM15/HP15C) as it needs to be accurate only between about 100 year time window.

I did found one that suits my use at: https://groups.google.com/forum/#!topic/...c9rcvY7d2s

Now interesting enough I did put 3 different methods to the excel worksheet to compare them simultaneusly.. If I take DDays from 28.2.1900 and 28.2.2100 I get results:

Excel (365): 73050
JDN-JDN^^: 73049
HP50g DDAYS: 73049
SIMPLE DDAYS**: 73050
WAlpha: 73049 ( https://www.wolframalpha.com/input/?i=DA...+28.2.2100 ) PS. As late though

So which ones are correct? Big Grin :/ Any idea.. I trush 50g more than excel, since also the JDN-JDN gives the same result but..
First I though that excel handles days as Ddays+1, but no it were false assumption since

DDAYS(28.3.1900,28.2.2100) returns as follows:
Excel: 73021
JDN-JDN: 73021
HP50g DDAYS: 73021
Simple DDAYS: 73020

EDIT2: Ahaa, Excel DAYS function starts at year 1900 that might explain this difference in this particular case.

Interesting.. Back to jellyfying my brains with day algorithms. :Z


** From mailinglist discussion
Y <- start year
M <- start month
D <- start day
Y <- Y-1
M <- M+13
X <- int(365.25*Y)+int(30.6*M)+D
https://groups.google.com/forum/#!topic/...c9rcvY7d2s

^^
As given in wikipedia.org
https://en.wikipedia.org/wiki/Julian_day
https://wikimedia.org/api/rest_v1/media/...0958a53d61

One might include both endpoints and one might not.
The difference between 1/5/2017 and 2/5/2017 would be 1 or 2 depending on that.

Tom L

Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Deltadays and date functions. - Vtile - 05-10-2017, 01:28 PM
RE: Deltadays and date functions. - Vtile - 05-10-2017, 01:50 PM
RE: Deltadays and date functions. - Vtile - 05-10-2017, 03:02 PM
RE: Deltadays and date functions. - toml_12953 - 05-10-2017 03:17 PM
RE: Deltadays and date functions. - Vtile - 05-10-2017, 07:55 PM
RE: Deltadays and date functions. - Dieter - 05-10-2017, 08:30 PM
RE: Deltadays and date functions. - KeithB - 05-10-2017, 04:30 PM
RE: Deltadays and date functions. - Dieter - 05-10-2017, 05:01 PM
RE: Deltadays and date functions. - Vtile - 05-10-2017, 07:16 PM
RE: Deltadays and date functions. - Dieter - 05-10-2017, 08:17 PM
RE: Deltadays and date functions. - Vtile - 05-10-2017, 05:12 PM
RE: Deltadays and date functions. - Dieter - 05-10-2017, 06:17 PM
RE: Deltadays and date functions. - Vtile - 05-11-2017, 11:33 AM
RE: Deltadays and date functions. - Dieter - 05-11-2017, 05:03 PM
RE: Deltadays and date functions. - Vtile - 05-11-2017, 04:17 PM
RE: Deltadays and date functions. - Dieter - 05-12-2017, 08:04 PM
RE: Deltadays and date functions. - Dieter - 05-13-2017, 01:32 PM
RE: Deltadays and date functions. - Dieter - 05-14-2017, 05:21 PM
RE: Deltadays and date functions. - Vtile - 05-12-2017, 11:58 PM
RE: Deltadays and date functions. - Dieter - 05-13-2017, 01:33 PM
RE: Deltadays and date functions. - Vtile - 05-13-2017, 07:15 PM
RE: Deltadays and date functions. - Dieter - 05-13-2017, 08:57 PM
RE: Deltadays and date functions. - Vtile - 05-13-2017, 10:30 PM



User(s) browsing this thread: 1 Guest(s)