Year(s) Month(s) Day(s) between 2 dates
|
10-28-2015, 12:11 PM
Post: #33
|
|||
|
|||
RE: Year(s) Month(s) Day(s) between 2 dates
(10-27-2015 11:25 PM)Dieter Wrote: The second case indeed throws a Domain Error since the program tried to calculate the difference between 31 February (!) and 1 March 2015. This should get fixed. Also changing the code to the alternative method you prefer is quite simple. Here is an updated version with a fix for the Domain Error at the expense of 3 additional steps for a total of 40 steps: Code: 01 LBL"YMD" ; stack: date2, date1 Compared to Franz version in 29 steps, this one is independent of the input date format as long as it is consistent with the WP 34S current Mode (output format is always YMD), and the results are aligned with WolframAlpha: in D.MY format: 18.071978 to 19.102015 --> 37.0301 14.051643 to 01.091715 --> 72.0318 23.021951 to 05.091999 --> 48.0613 01.012000 to 01.022000 --> 0.01 31.012015 to 01.032015 --> 0.0101 31.012015 to 01.042015 --> 0.0201 in M.DY format: 07.181978 to 10.192015 --> 37.0301 01.312015 to 03.012015 --> 0.0101 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 12 Guest(s)