in reply to Portable previous dates

I'm hoping for a portable solution, (so don't want to install CPAN modules to do this) as this isn't an option on the machines this script is being use on.

Sure it is :) This is a FAQ (Frequently Asked Question) :) Yes, even you can use CPAN

Doing date math by yourself sucks :) DateTime, Date::Manip, Time::gmtime, Time::...