UNIX format timestamps have an extensive range of use. You will find out the main reasons that back up this claim, but for now, let’s say that it is because working with dates and times in the UNIX time format is easier and more resource efficient. In this article, our goal is to demystify the concept, learn the theory that lies behind it, and ultimately write algorithms and implementations that convert dates back and forth from the traditional ISO standard to UNIX format.
We’ve come to the end of this article. On these pages, I’ve shown you how to work with UNIX timestamps. Most importantly, we’ve demystified this concept. Those long strings of digits are all around us and some people haven’t a clue how the heck they can represent a date when they seem silly and sometimes even random.
It’s really important to understand the mathematical theory that lies within UNIX timestamps, because if we have a strong grasp on it, we can do the conversions ourselves—even by hand on a sheet of paper with a pen. Of course, we can also write our own convert functions in any programming language.
After we learned the UNIX timestamps, we moved on to some practical real-world examples. Basically, you found lots of conversion implementations in various programming languages (even shell scripting). I explained the code samples and we also examined the syntax of the functions we opted to use.
Should you have more questions or uncertainties, don’t hesitate to join the Dev Hardware Forums. It’s an ever-growing place with a very friendly and professional community made up of lots of technology experts and enthusiasts. Our focus lies mostly on hardware, software, and consumer electronics.
I hope that you’ve found this article informative and educational. Hopefully, you won’t be scared away the next time you notice a long string of digits representing a date, and you won’t think that the “coder” who is mumbling about dates is insane. On top of this, you learned how to convert plain English-like dates (along with times) back and forth to UNIX time.