Deltadays and date functions.
|
05-10-2017, 07:16 PM
(This post was last modified: 05-10-2017 07:20 PM by Vtile.)
Post: #11
|
|||
|
|||
RE: Deltadays and date functions.
Naturally it started to rain (a snow!) again when I got outside.. So I get in to this today.
(05-10-2017 05:01 PM)Dieter Wrote:No no no... Not a heavy as is, but judged by the use case. Ie. as a part of financial calculation programs. Or just to check how far the next holiday were.(05-10-2017 01:28 PM)Vtile Wrote: I have been in seach of simple algorithm to calculate dDays between two dates. In general JDN algorithm is really sophisticated and simple (that sounds like I would understand it through). (05-10-2017 05:01 PM)Dieter Wrote:But isn't 2100 a regular year as it is divisable with 100 and 4, but not 400. I must be mixing up something now. (Assuming the RPN program you kindly provided doesn't take somehow account the "regular year if divisable with 100" rule. My RPN still needs to some practice to fluently read it.)(05-10-2017 01:28 PM)Vtile Wrote: ...as it needs to be accurate only between about 100 year time window. (05-10-2017 05:01 PM)Dieter Wrote:I see it now, while I still fully understand it.(05-10-2017 01:28 PM)Vtile Wrote: I did found one that suits my use at: https://groups.google.com/forum/#!topic/...c9rcvY7d2s (05-10-2017 05:01 PM)Dieter Wrote:This were suprising, while I did know that it do have quirks in number handling etc. (which I learned from here) I would have assumed it have state of the art calendar functions for accounting and so forth reasons.(05-10-2017 01:28 PM)Vtile Wrote: 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: (05-10-2017 05:01 PM)Dieter Wrote:Yes, now I see the function of the 0,25 (1/4) as it is calculated to days with INT/FLOOR only each four years, so it makes the leap year handling in this narrow implementation.(05-10-2017 01:28 PM)Vtile Wrote: ** From mailinglist discussion On the other hand I still not get it how the months are handled so sophisticated that the sequence 31,28(**),31,30,31,30,31,31,30,31,30,31 (2+5+5) drops in to that 0.6 with the month shifting IF M<3 THEN M=M+12 and Y=Y-1.. *scratching his head* **not +1 since that is handled by years multiplier with fraction .25 Well it is 3/5 so it is also found from the JDN algorithm and also from the algorithm mentioned by Don Shepherd.. Somehow it relates to that divisor 5. Well someday I need try to figure how the gears rotate on that one. (05-10-2017 05:01 PM)Dieter Wrote: A 15C program can be done in a few minutes:Do you mind if put a link to this program in my (X)IRR/(X)NPV topic at http://www.hpmuseum.org/forum/thread-8322.html. Edit. I lost what I were going to edit.. curse of long quote of quote posts. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)