I know the right syntax for displaying the current date is $(date). However, I am planning to send emails to some customers which displays their subscription date, and then the expiry. The expiry being 30 days from the current date.
Some of the systems (eg Solaris) may not have those features in the 'date' command. If you are looking for portable solution, you may want to use perl. I believe most of the modern system will have perl 4 or above.
Here is my function that you can adopt in your shell script
function later()
{
perl -e '
$t=time()+'${1:-30}'*86400;
@t=localtime($t);
printf("%04d-%02d-%02d",$t[5]+1900,$t[4]+1,$t[3]);'
}
later 30