date(1)で日時の差を計算
code:bash
bc <<< "(date +%s - date --date='210306' +%s) / (60 * 60 * 24)"
# (1721746356 - 1614988800) / (60 * 60 * 24)
--date=STRINGの書式が気になったので調べた
許容されるフォーマットがかなりたくさんある。
DATE STRING
The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date string may contain items indicating calendar date, time of day, time zone, day of week, relative time, relative date, and numbers. An empty string indicates the beginning of the day. The date string format is more complex than is easily documented here but is fully described in the info documentation.
あるいはこれ?