Page MenuHomec4science

date-diff
No OneTemporary

File Metadata

Created
Tue, Feb 25, 06:50

date-diff

#!/bin/bash
PARM=2
if [ $# -ne $PARM ]
then
echo "Wrong # param. Need $PARM got $# "
echo "Usage: ./this end_date(one_string) start_date(one_string)"
exit
fi
# Prepend '20' to the 2-digit year to avoid ambiguity
D1="20"$1
D2="20"$2
#echo $D1
#echo $D2
echo $((`date +'%s' -d "$D1" `-`date +'%s' -d "$D2"`))

Event Timeline