Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to add time in minutes in datetime string PHP?
For this, you can use the strtotime() method.
The syntax is as follows −
$anyVariableName= strtotime('anyDateValue + X minute');
You can put the integer value in place of X.
Example
The PHP code is as follows
<!DOCTYPE html>
<html>
<body>
<?php
$addingFiveMinutes= strtotime('2020-10-30 10:10:20 + 5 minute');
echo date('Y-m-d H:i:s', $addingFiveMinutes);
?>
</body>
</html>
Output
This will produce the following output
2020-10-30 10:15:20
Advertisements
