I would like to show me the date minus 5 minutes from the current time; my code is like this:
(date('Y-m-d H:i-5:s'))
but it's not correct because var_dump
produces:
2012-08-08 13:27-5:49
Any ideas on how can I do this?
PHP Function:
strtotime()
Example:
echo date('Y-m-d H:i:s', strtotime('-5 minutes'));
Try this It's solve your problem
$format = "h:i A";
date_default_timezone_set('Asia/Kolkata');
echo date($format, strtotime("-5 minute"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With