I'm not really sure where you are stuck because you did not provide a lot of information or example, but you could consider the following commands:
chage -l userName to check the expiration date of a user's password
mail to send an email either to the user or to the admin (or both) (as said by Graeme in his comment)
With these two commands, you should be able to write a simple script to check for password expiration.
You could also use
crontab for the scheduling (daily basis for instance).
Following your edit with more information, you can try as follows:
# Get the current date in seconds since 1970
# Convert the date you want to check in seconds since 1970
date_to_check=`date -d 2015/03/31 +"%s"`
# Calculate the difference in seconds
date_diff=`expr $date_to_check - $current_date`
# Check whether the difference is greater than 31 days (2678400 seconds)
if [ `expr $date_diff - 2678400` -gt 0 ]
echo More than 31 days left
echo Less than 31 days left