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 KingdomPosts: 1985 |
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. |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1133 |
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 KingdomPosts: 1985 |
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. |
||||
CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 1985 |
updated the function to be more flexible with how the date string is interpretted |
||||
Print this page |