That's great. Thanks. I was already using POSIX earlier in the script for mktime to get my time in seconds but didn't know about strftime. Looks much better and cuts out several lines.
Thanks to everyone else to. I'm trying out each of your suggestions.