{ads}

Counting the days on Linux



June 22, 2022 at 12:40AM

Have you ever wondered how many days it’s been since you started your diet, begun your daily jogs, or were first working with Linux? If you can remember the start date, a simple Linux script can count the days for you. All you need is the date command and a calculation that turns your dates into seconds, subtracts the start date from the end date and then divides the result by the appropriate number to turn the seconds into the corresponding number of days.

Why seconds?

The reason for the conversion to days is that the date command can display a date as the number of seconds since the start of the Linux epoch—10=970-01-01. This is the only option date provides for looking at the time difference between two calendar dates.

To read this article in full, please click here



from Network World https://www.networkworld.com/article/3664077/counting-the-days-on-linux.html#tk.rss_all

0 Response to "Counting the days on Linux"

Post a Comment

Article Top Ads

Central Ads Article 1

Middle Ads Article 2

Article Bottom Ads