How to add one hour in php date?

Ads
 

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

Ads









Related Tutorials/Questions & Answers:
How to add one hour in php date?
How to Addding One Month with PHP ?
Advertisements
javascript add hour to time
days between two given dates using PHP
how to dynamically create one file with any example in php
how can i display the dates of one week by selecting the date randomly from the calendar?
PHP and MySQL BETWEEN dates with different years
How to add
ModuleNotFoundError: No module named 'datec'
ModuleNotFoundError: No module named 'datec'
how to scrape the data from one website another website using html dom parsing in php
How to add "View more results" kind of functionality in my PHP based website?
How to select Data Between Two dates in Java, MySQL
add one row after another
list of all months between two dates in java
list of all months between two dates in java
How to Prepend Array in PHP
how to put php in javascript
How to learn PHP
Comparing two dates in java
how to update image in php
how to use calender in php
How to retrieve the ISO Date in PHP?
How to Declare Abstract Class in PHP ?
How to add JTable in JPanel
how to add to numbers in java
how to add dynamic data
how to add mulitiple projections
how to add a file in GZIP
How to add BigDecimal in Java?
ModuleNotFoundError: No module named 'django-dated-values'

Ads