Date and time management libraries in many programming languages are famously bad. Python’s datetime module comes to mind as one of the best (worst?) examples, and so does JavaScript’s Date class. It feels like these libraries could not have been made worse on purpose, or so I thought until today, when I needed to implement some date calculations in a backup rotation script written in bash.

So, if you wanted to learn how to perform date and time arithmetic in your bash scripts, you’ve come to the right place. Just don’t blame me for the nightmares.

Why bash?

This is a valid question. Why bother doing this in bash when you can drop into Python or Node? In my …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help