Answers for "subtraction of date in php"

PHP
0

subtract some days php

// First date of the month.
$monthFirstDate = date('Y-m-01', strtotime('today'));

// Last date of the month.
$monthLastDate = date('Y-m-t', strtotime('today'));

// Second last date of the month
$monthLastSecondDate = date('Y-m-d', strtotime('-2 day', strtotime('today')));
Posted by: Guest on September-07-2021
0

php subtract seconds from datetime

echo date("Y-m-d H:i:s", strtotime($date) - 600);
//2014-03-16 17:30:27
Posted by: Guest on September-28-2021

Browse Popular Code Answers by Language