Epoch (Unix time)
|
01-06-2018, 06:07 PM
(This post was last modified: 01-06-2018 08:47 PM by salvomic.)
Post: #1
|
|||
|
|||
Epoch (Unix time)
hi,
here it is a possible implementation of epoch (unix time, second's number from 1970 Jan 1 at midnight) for the Prime. See here for the definition. • epoch(date, time, timezone) returns epoch number given date (i.e. 2018.0106, -1 for current Date), time (i.e. 15°22'30'', -1 for current Time), time zone (0 for UTC/GMT, +1, -1...) • epoch2date(epoch, timezone) returns a list with date and time (format: {2018.0106, 15°22'30''}) given epoch number of seconds and timezone. Every values converted in GMT/UTC time Code:
Enjoy! Salvo *** Original idea: epoch for HP-41CX ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
01-06-2018, 09:39 PM
(This post was last modified: 01-07-2018 09:35 AM by salvomic.)
Post: #2
|
|||
|
|||
RE: Epoch (Unix time)
In this version the user can simply input Date and/or Time and his/her timezone to get current date and time. User can write directly epoc(Date, Time, -5) or input those variables via Vars Catalog.
Otherwise he/she can input a date (format of the Prime: 2018.0106), a time (use the template in shift-E to input i.e. 12°40'32'') and the timezone (timezone is relative to UTC in hours)... Code:
∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)