Script to check if last modified day is previous day

Hi,
I would like to write a script that checks if a file ('counter') was modified the previous day, if so erase its contents and write 00000000 into it.
For e.g. if the file 'counter' was last modified at 11.30pm on 24th May and the script runs at 12.15am of 25th May, it should erase it's contents and write 00000000 into it.
I know it's not a great question but apologies, I'm new to unix and shell scripting.
Thanks.

#!/bin/sh
file_name="tempfile.txt"
previous_day=`TZ=GMT+24 date +%b" "%d`

file_cnt=`ls -lrt $file_name| grep "$previous_day" | wc -l`

if [ "$file_cnt" -gt 0 ]
then
echo "00000000" > $file_name
fi