HP Forums

Full Version: DDAYS and "financial" year
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,
DDAYS is really useful (like also DATEADD and DAYOFWEEK)!
In a next update of FW it would be nice to add an option to handle "financial" (or "commercial") year (months of 30 days, 360 days of years), useful for calculation of simple interest (like HP 12C do).

Formulas are in the User Guide of 12C (Appendix E, page 250). 12C can handles dates both as m.ddyyyy, d.mmyyyy, so those formulas are intended for theese formats...

Salvo
maybe it's enough a formula as n:=30*(mm2-mm1)+dd2-dd1 like in my program to calc Simple Interest...
dd1, dd2 are days, mm1, mm2 months ...

However attention for a problem in DDAYS: it doesn't control for "typical" errors:
i.e. DDAYS(2015.0201,2015.0229) gives "Error: invalid input", as Feb 29 doesn't exists (in 2015)...
We need also a leap year control :-)
Moreover DDAYS ignores date format settings, e.g. with European format preset (mm/dd/yyyy), it nevertheless wants input in the form yyyy.mmdd
(05-19-2015 12:58 PM)rkf Wrote: [ -> ]Moreover DDAYS ignores date format settings, e.g. with European format preset (mm/dd/yyyy), it nevertheless wants input in the form yyyy.mmdd

All the date functions are like that, to be consistent with the Date system variable, which always returns dates in YYYY.MMDD format. I'm pretty sure that the "date format display" Home Setting only changes the display of the Home Settings screen (page 2) and the upper-right-corner popup clock/calendar; it has no effect on programs. This is a Good Thing.
Reference URL's