yanivk1984
7/23/2019 - 8:07 PM

linux parse dates

date +"%d_%m_%Y"
# output: 23_07_2019

date +"%d/%m/%Y %H:%m:%S"
# output: 24/07/2019 09:07:17

date +"%a %b %d %H:%M:%S %Y"
# output: Mon Nov 11 23:33:45 2019

# check differences between two dates in days
DATE_EPOCH=`date -d "$DATE" '+%s'` ; NOW=`date +%s` ; DIFF=`echo $(( ( $DATE_EPOCH - $NOW )/(60*60*24) ))`