For some reason this code:
localtime()+(param("saleend") * 24 * 60 * 60)
is putting the output of 604800 which is the param("saleend" * 24 * 60 * 60) (saleend is equal to 7).
Why would localtime() not have a value? Is it NOT a built in Perl function?