This is highly untested and might need some fine tuning when it comes to retrieving the date.
Code:
#!/bin/bash
path=$1
# Get the current epoch timestamp
epoch_old=$(date +%s)
# How many days back are we looking
days=$2
# Calculate the amount of seconds X days are and subtract it from the current date.
let epoch_old=epoch_old-\(86400*days\)
# Make sure we have the correct time styled output from ls(1)
OPT="--time-style=+%c -l"
# List all the files in $path
for i in $(ls $path $OPT); do
# Chop out the creation timestamp
time=$(echo $i | awk '{print $6" "$7" "$8" "$9" "$10" "$11}')
# Filename
file=$(echo $i | awk '{print $12}')
# Figure out the epoch timestamp from the creation timestamp of the filename
epoch_time=$(date --date "$time" +%s)
# If the line above creates a number greater then what we created at the top of the file then the file is newer and vice versa
if [ $epoch_time -lt $epoch_old ]; then
# rm $file ...
# Execute commands when the file is too old here.
echo "File $file is older $days days"
fi
done
Usage: ./script.sh /path/to/files <days>
Hope this atleast gives you a hint how you can do it

and as i said, highly untested (I don't have a GNU ls or GNU date atm so can't really test it

)
Best regards
Fredrik Eriksson