-3

I have date in the format of 10/2/23. How can I get the difference of 10/2/23 to todays date? Please advise.

bhu
  • 1

1 Answers1

0

Time diff in integral seconds or integral days:

$ echo $(($(date +%s -d "10/2/23") - $(date +%s)))
11485596
$ echo $((($(date +%s -d "10/2/23") - $(date +%s))/(24*60*60)))
132
stevea
  • 431