Here is how to quickly calculate the days since a date, like your birthday from commandline bash:

export START=1979-05-28 && echo $((($(date +%s)-$(date +%s --date "$START"))/(3600*24))) days

Reply to this note

Please Login to reply.

Discussion

9883 for me!

Amazing! What will you do with it?

🤣drain myself with programming

🫂

I stayed beautiful every day as much as possible. Even when people were toxic , nasty, or wasted my time.....

#Beautiful at any age

#Beautiful processing

As Psychologist I reccomend- toxic people- move on, dont let them ruin your day!

Unfortunately obfuscatory, and bash already doesn't need any help with that

Can you simplify?

I bet ChatGPT would have a proposal

Try it

Make it a function like this. I remove the "days" string as I have more uses without it in scripts. Also simplified seconds per day

dayssince () {

echo $((($(date +%s)-$(date +s --date "$1"))/(86400)))

}

You can put that in your ~/.bashrc or other scripts loaded from such to simply call

dayssince 1979-05-28

If you want the "days" string, can call

printf "%d days" $(dayssince 1979-05-28)