in reply to how do i get yesterday's date using localtime()?

Try this:
$now = scalar localtime(time-86400);
--gabriel