$today = strtotime(date(dny)); $daybefore = $today - 86400; print date(dny); print "\n\n $today $daybefore \n\n"; print date(dny,$today); print "\n\n"; print date(dny,$daybefore); gives: 11906 1025935200 1025848800 06702 05702