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.
Asked
Active
Viewed 59 times
-3
-
1duplicates: Quickly calculate date differences, Calculate time difference between two dates, Date Difference Calculation... – phuclv May 22 '23 at 01:22
-
6is that day month year or month day year? – Jaromanda X May 22 '23 at 01:22
-
see also Unix: how to get number of days from a given date like 10Dec2022 – steeldriver May 22 '23 at 01:23
-
This question does not show the first step effort. Perhaps ChatGPT make this all for you. – Thibault LE PAUL May 28 '23 at 19:13
1 Answers
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