Time functions in Prime after firmware 7820
In these and other articles to come, we will discuss some of the new features of the new HP Prime firmware, numbered 7820.
(By the way, one of the things I look after each firmware update is the power consumption of the calculator. Not using a multimeter and seeing the the actual current demanded from the batteries in standby, running programs and dormant; but paying attention on how long it takes from consecutive charges. It is good to mention that it doesn’t consume more, but, if anything, batteries last longer now. Again, not a scientific measure)
Today we will talk about the new time functions. Prior to this release, there were several time-related functions, but pretty much low level, like reading the number of ticks from the internal clock. This has limited use for a normal user - it is much more aimed to the programmer that needs to time events in the program flow.
Now, let’s discuss the new time functions, starting with algebraic or txt book data entry format.
The new functions are:
DDAYS(Date1, Date2).
It calculates the number of days between two dates. The format is the more generic YYYY.MMDD (but equally odd for U.S. and European users). The use of either American or European date formats would have created the need for much more hassle; just take a look to what happens with the simpler decimal point or comma, and the separation of digits in number format. It actually make some functions and programs to fail. but then why are there here options for setting the date format in the setting pages? It seems that it only applies to the Prime’s right upper corner display!
It doesn’t have any of the options of the HP19bii or hp17bii namely, the ability to calculate in 360 and 365 days, as opposed to the more standard natural calendar. I like the fact that the same name used in the Hp41c’s time module has been used here.
Please remember than in RPN you need to put Date1 in level 2 of the stack, Date2 in level one and only then enter DDAYS and ENTER!
DATEADD(Date, number of days)
Adds the number of days to the date, returning the result in Prime’s date format (YYYY.MMDD). Here the name deviates from what is burned in my ROMs! It gives a single result, not showing the day of the week as many other hp calculators did. Same as above for RPN: enter first date, then days to add, then the function!
DAYOFWEEK(Date)
Well, pretty much self-explaining name. Again, the date has to be entered in YYYY.MMDD format. It returns a number, not a string. It takes the convention of calling “1” to Monday, and so forth. Same provisos as above for RPN: first date, ENTER, function name and ENTER again.
(While I was looking at Prime’s help system for these functions, I noticed that there was a menu item I had not seen before: “Other”. When clicking on it, I found it showed the other two functions of the lot, screen-selectable. That’s a clever device! I am looking forward to see other function families to see how the help system organizes them in like-sets.)