Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:06 03 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Unixtime function added to library

Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 03:33am 31 Jul 2017
Copy link to clipboard 
Print this post

Those of you who work with larger systems may be familiar with the concept of Unixtime (sometimes called Epochtime)

I added a function for this calculation today here

Unixtime is the elapsed seconds since 01-01-1970 00:00:00 and as a straight numerical format eliminates the confusion between the various date string formats. It is only whole seconds (some go down to mS)

I will post a "HumanTime" function soon (when I get round to writing it) to provide conversion back and forth between the two

I have tested with extremes and known dates and it looks good when compared to big-boys computers.Edited by CaptainBoing 2017-08-01
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 08:31am 01 Aug 2017
Copy link to clipboard 
Print this post

Hi Captain Boing!

Thank you for the efforts. I wanted to have that for a long time.
Congratulation!
Regards
Michael
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 09:54am 01 Aug 2017
Copy link to clipboard 
Print this post

no probs, u r welcome. I will write the reverse function soon (probably this weekend). Unixtime is a nice compact date/time method - it is vital for logging on small storage/memory systems - like micromites.Edited by CaptainBoing 2017-08-02
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 06:18am 03 Aug 2017
Copy link to clipboard 
Print this post

updated the function to be more flexible with how the date string is interpretted
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024