Unix/Linux Epoch Time Converter..
|
12-31-2017, 07:21 PM
(This post was last modified: 12-31-2017 07:27 PM by Bill Duncan.)
Post: #10
|
|||
|
|||
RE: Unix/Linux Epoch Time Converter..
I thought I'd try my hand in doing an HP-48GX RPL version. Haven't used RPL for awhile, so excuse me if it isn't optimal..
The nice things about the RPL version is that it can test the depth of the stack (so use the current date/time if you haven't entered anything) and, of course it can display the entire date/time string on a single line.. ->EPOCH Code:
and.. EPOCH-> Code:
The last routine leaves the date and time in the stack as well as displaying the string. As in the original version, 18000 is for EST (Eastern Standard Time) and is the number of seconds relative to GMT or UTC. I've put several instructions on a single line for clarity. You should be able to test one against the other by executing "->EPOCH" then translating back with "EPOCH->". Hope these routines are useful to other unix/linux sysadmins.. Cheers. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)