How to add one hour in php date?

How to add one hour in php date?

I have a date variable in PHP and I want to add one hour to it. What is the code for adding one hour to the PHP date?

Thanks

View Answers

February 14, 2015 at 4:18 PM

Hi,

You should convert the date into time and then add convert the 60 minute (one hour) into time.

Then add the both to get and convert it to date. This way you can achieve the result.

$currentTime = time($todayDate);

//Add one hour equavelent seconds 60*60

$timeAfterOneHour = $currentTime+60*60;

Check the tutorial Adding one hour in php.

Thanks









Related Tutorials/Questions & Answers:
How to add one hour in php date?
PHP Date add 1 hour
Advertisements
How to Addding One Month with PHP ?
days between two given dates using PHP
javascript add hour to time
How can we know the number of days between two given dates using PHP?
PHP Date compare the dates, PHP Compare dates example
how can i display the dates of one week by selecting the date randomly from the calendar?
ModuleNotFoundError: No module named 'datec'
ModuleNotFoundError: No module named 'datec'
PHP and MySQL BETWEEN dates with different years
how to dynamically create one file with any example in php
PHP Date add 1 month
How to Add Array Item in PHP
PHP Date add 1 year
PHP add parameter to url - PHP
list of all months between two dates in java
list of all months between two dates in java
How to select Data Between Two dates in Java, MySQL
ModuleNotFoundError: No module named 'django-dated-values'
how to scrape the data from one website another website using html dom parsing in php
PHP date add, PHP Date addition to a date object
Comparing two dates in java
add one row after another
python add one day to date
python add one day to date
PHP GD add text to image
PHP GD add text to image
PHP Date add days
Javascript calculate number of days between two dates
How to add "View more results" kind of functionality in my PHP based website?
PHP GD Add Border to image
PHP date add function
Hour Format Example
calculate working hour
How to Prepend Array in PHP
ModuleNotFoundError: No module named 'api_hour'
how to put php in javascript
How to learn PHP
Array Add Key Value PHP
how to use calender in php
how to update image in php
how to check dates while retrieving data from database
PHP Date add 1 day
display dates between two dates - Java Beginners
How to retrieve the ISO Date in PHP?
How to add
mysql between dates not between dates
How to learn PHP?
How to Declare Abstract Class in PHP ?

Ads