(71B) Days From January 1, Days Between Dates - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (71B) Days From January 1, Days Between Dates (/thread-6478.html) |
(71B) Days From January 1, Days Between Dates - Eddie W. Shore - 06-30-2016 02:38 AM HP 71B – Day Counts Number of Days from January 1 D = Day M = Month L = Leap Year indicator (1 if the year is a leap year, 0 if it is not) Code: Program DAYJAN1 (183 bytes) Test 1: January 1 to May 29, non-leap year (L=0). Result: 148 Test 2: January 1 to May 29, leap year (L=1). Result: 149 Days between Dates M, D, Y: Month, Day, four-digit year Code: Program DDAYS (299 bytes) Test 1: January 2, 2015 to March 17, 2016 (1,2,2015 to 3,17,2016). Result: 440 Test 2: March 14, 1977 to June 29, 2016 (3,14,1977 to 6,29,2016). Result: 14352 |