Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

simple php time function

Posted on 2016-11-07
2
Medium Priority
?
63 Views
Last Modified: 2016-11-07
hello, I use php and I have a simple question regarding php date property

how can add 10 days to $todayis = date("Y-m-d H:i:s");

I'd like echo $todayis value + 10 days
0
Comment
Question by:Braveheartli
2 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 41877049
Please see: https://iconoun.com/demo/temp_braveheartli.php
<?php // demo/temp_braveheartli.php
/**
 * https://www.experts-exchange.com/questions/28981436/simple-php-time-function.html
 */
error_reporting(E_ALL);

$todayis = date("Y-m-d H:i:s");
$future  = date("Y-m-d H:i:s", strtotime("$todayis + 10 DAYS") );
var_dump($todayis, $future);

Open in new window


Bookmark these articles:
https://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL-Procedural-Version.html
https://www.experts-exchange.com/articles/20920/Handling-Time-and-Date-in-PHP-and-MySQL-OOP-Version.html
1
 
LVL 1

Author Closing Comment

by:Braveheartli
ID: 41877238
Thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question