The approach I'd use would be to use a regex or a module (e.g.
Date::Parse) to parse your date-time string into (year/month/day/hour/min/sec pieces), and them use
POSIX::mktime to convert this into a unix time_t value (this measures the number of seconds since 'epoch', 1 Jan 1970).
You then only keep a line if it's timestamp is more recent than time() - $NUM_OF_SECOND_IN_TWO_DAYS.
Doing it this way avoids all end-of-month/-year etc. problems.