-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.

4

1 Answer 1

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
1
  • Thank you that worked.
    – bhu
    May 22 at 9:18

Not the answer you're looking for? Browse other questions tagged .