epoch Prime +- HP Forums (http://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: epoch Prime (/thread-9859.html) |
epoch Prime - salvomic - 01-05-2018 11:00 AM hi, following an idea by Bill Duncan (see this MoHPC thread), is there anyone so kind to help me to make a program (or a set of commands) to get: • current date and time -> epoch (Unix) • epoch -> current date and time • any date_and_time -> epoch and reverse giving to the user the option to set Time Zone also? The program should also avoid the "2038 bit overflow"... The goal is to use when possible built-in commands, for precision purpose. It a simple but useful idea to control epoch offline (when one is controlling logs or other things or for funny). I'm using the Bill's program in HP-41CX and also in Free42s. Now I thought to make something for the Prime, but not only by myself ![]() Thank you Salvo RE: epoch Prime - salvomic - 01-06-2018 09:45 AM (01-06-2018 09:28 AM)pier4r Wrote: Little nitpick. yes, this last paragraph of your post is the real explanation of why most of us here use short vars and few comments... I understand your thoughts and appreciate, however just now the program is still not finished, so the most important thing is if it works and how, then we can refactor variables and put in some other comments... As I wrote in the first post, our goal is to make a program the more concise (and, if possible, as you wrote, the more user-friendly). First of all we must solve some problems: • to use less parameters (I mean reuse the parameters for date and time without "magic numbers" for the case in which the user wants to use the current date and time or he/she wants to input another date) • to decide if it is important (or not so important) to give also "local time" epoch, or only (and always) GMT/UTC epoch (as it is now in the program). • to decide if there is a reason to "complicate" the program, with calculation of leap seconds or other important considerations or not... Salvo EDIT: as pier4r suggested, the version without "magic constants" it: Code:
|