Post Reply 
epoch Prime
01-06-2018, 09:41 AM (This post was last modified: 01-06-2018 10:12 AM by Dieter.)
Post: #22
RE: epoch Prime
(01-06-2018 09:28 AM)salvomic Wrote:  
Code:
ti:=(epoch MOD 84600)/3600;
...
epoch2date(1515230706) returns {2018.0106, 12.41833333}
→HMS(12.41833333) returns 12°25'06'', that two hours later, but still I must set UTC problem...

It's not a timezone problem. Take a closer look at the quoted code line. ;-)

BTW the result is UTC, so if you want local time you'll have to add 3600 s to epoch at the beginning. Just as you subtract it at the end of the opposite conversion.

BTW2: Why do you return the time as 12,4183333333 instead of 12,2506? This doesn't take more than a simple h.ms conversion.

Or, if you want to return hours, minutes and seconds separately, you may do it this way:

seconds = epoch mod 86400
hh = IP(seconds/3600)
mm = IP(seconds mod 3600)/60)
ss = seconds mod 60

Edit: Or with "iquo" as mentioned by Didier:

seconds = epoch mod 86400
hh = iquo(seconds, 3600)
mm = iquo(seconds mod 3600, 60)
ss = seconds mod 60

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
epoch Prime - salvomic - 01-05-2018, 05:00 PM
RE: epoch Prime - pier4r - 01-05-2018, 06:03 PM
RE: epoch Prime - Dieter - 01-05-2018, 07:30 PM
RE: epoch Prime - salvomic - 01-05-2018, 07:42 PM
RE: epoch Prime - Dieter - 01-05-2018, 07:51 PM
RE: epoch Prime - salvomic - 01-05-2018, 08:07 PM
RE: epoch Prime - Dieter - 01-05-2018, 08:47 PM
RE: epoch Prime - salvomic - 01-05-2018, 09:10 PM
RE: epoch Prime - Dieter - 01-05-2018, 09:27 PM
RE: epoch Prime - salvomic - 01-05-2018, 09:36 PM
RE: epoch Prime - Dieter - 01-05-2018, 10:07 PM
RE: epoch Prime - salvomic - 01-05-2018, 10:16 PM
RE: epoch Prime - Dieter - 01-05-2018, 10:48 PM
RE: epoch Prime - pier4r - 01-05-2018, 09:40 PM
RE: epoch Prime - salvomic - 01-05-2018, 09:44 PM
RE: epoch Prime - Dieter - 01-05-2018, 09:56 PM
RE: epoch Prime - salvomic - 01-05-2018, 06:17 PM
RE: epoch Prime - salvomic - 01-05-2018, 11:26 PM
RE: epoch Prime - Dieter - 01-06-2018, 08:53 AM
RE: epoch Prime - salvomic - 01-06-2018, 09:28 AM
RE: epoch Prime - Dieter - 01-06-2018 09:41 AM
RE: epoch Prime - Didier Lachieze - 01-06-2018, 09:50 AM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 09:40 AM
RE: epoch Prime - pier4r - 01-06-2018, 10:46 AM
RE: epoch Prime - Dieter - 01-06-2018, 12:42 PM
RE: epoch Prime - salvomic - 01-06-2018, 01:07 PM
RE: epoch Prime - salvomic - 01-06-2018, 02:45 PM
RE: epoch Prime - Dieter - 01-06-2018, 06:26 PM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 08:26 PM
RE: epoch Prime - Dieter - 01-06-2018, 08:37 PM
RE: epoch Prime - pier4r - 01-06-2018, 09:59 PM
RE: epoch Prime - salvomic - 01-06-2018, 10:07 PM
RE: epoch Prime - pier4r - 01-06-2018, 10:55 PM
RE: epoch Prime - pier4r - 01-06-2018, 03:28 PM
RE: epoch Prime - salvomic - 01-06-2018, 03:45 PM
RE: epoch Prime - salvomic - 01-06-2018, 04:10 PM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 06:54 PM
RE: epoch Prime - salvomic - 01-06-2018, 07:58 PM
RE: epoch Prime - salvomic - 01-06-2018, 08:45 PM
RE: epoch Prime - Dieter - 01-06-2018, 08:59 PM
RE: epoch Prime - salvomic - 01-06-2018, 09:01 PM
RE: epoch Prime - Dieter - 01-06-2018, 11:07 PM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 11:24 PM
RE: epoch Prime - salvomic - 01-07-2018, 09:26 AM
RE: epoch Prime - Dieter - 01-07-2018, 06:22 PM
RE: epoch Prime - salvomic - 01-07-2018, 06:28 PM



User(s) browsing this thread: 1 Guest(s)