Skip to content

Instantly share code, notes, and snippets.

@mikesea
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikesea/770f5585d83e8eed7b61 to your computer and use it in GitHub Desktop.
Save mikesea/770f5585d83e8eed7b61 to your computer and use it in GitHub Desktop.
startdate=2015-01-01
enddate=`date "+%Y-%m-%d"`
startDateTs=`date -j -f "%Y-%m-%d" $startdate "+%s"`
endDateTs=`date -j -f "%Y-%m-%d" $enddate "+%s"`
dateTs=$startDateTs
offset=86400
while [ "$dateTs" -le "$endDateTs" ]
do
date=`date -j -f "%s" $dateTs "+%Y-%m-%d"`
printf '%s\n' $date
dateTs=$(($dateTs+$offset))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment