<?php $N = $_GET['day']; echo date("Y-m-d H:i:s",strtotime("-$N day")); echo date("Y-m-d H:i:s",strtotime("$N day"));