Calculate Unix Time from Date Time

9 views
Skip to first unread message

Cam

unread,
Jun 6, 2015, 10:00:08 AM6/6/15
to solde...@googlegroups.com
Hi,

Can anyone recommend a nice way to calculate Unix time from Date time?

Eg using 10:00:00 06/06/2015 calculate1433584800 ?

Thanks for any pointers.

Cheers,

Cam

Paul Curtis

unread,
Jun 6, 2015, 10:54:12 AM6/6/15
to solde...@googlegroups.com
Cam,

You can use the Zeller function to convert a date expressed in (y, m, d) to a monotonic integer sequence.

However, CoreBasic has MKDATE(Y, M, D) to make the current date, Zeller-style.

So, you can probably use:

TIMENOW = MKTIME(h, m, s)
DATENOW = MKDATE(y, m, d)
PRINT “Unix time = “; 3600*12*DATENOW + TIMENOW

…I think.

— Paul.

--
--
You received this message because you are subscribed to the Google
Groups "SolderCore" group http://groups.google.com/group/soldercore?hl=en

---
You received this message because you are subscribed to the Google Groups "SolderCore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to soldercore+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cam

unread,
Jun 6, 2015, 11:45:42 AM6/6/15
to solde...@googlegroups.com

Thanks Paul,

 

Very cool – you have all sorts of nice tools hidden away under the bonnet J

 

Worked like a charm – UNIX time was simply DATENOW+TIMENOW

 

Cheers,

 

Cam

Reply all
Reply to author
Forward
0 new messages