Solved

simple php time function

Posted on 2016-11-07
2
48 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

710 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