Calculate days in BASH

I need a quick ways to calculate age in days from a given date, so i use this command:

echo \(`date +%s`-`date -d '2012-04-01' +%s`\)/86400 | bc

No comments:

Post a Comment