$now = date_create(); $interval = new DateInterval('PT10S'); $before = date_sub($now, $interval); echo date_format($before, 'Y-m-d H:i:s');In this example, we first create a new datetime object using the date_create() function. We then create a new DateInterval object representing 10 seconds using the 'PT10S' format. We subtract this interval from the current date and time using date_sub(), and finally, we format the resulting datetime object using date_format() and output it. This function is part of the PHP's built-in date and time library.