Solved

date + 1 day`

Posted on 2013-05-12
6
576 Views
Last Modified: 2013-05-13
date written in this format
year month day
2013-05-13

want date + 1 day
2013-05-14
0
Comment
Question by:rgb192
6 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 200 total points
ID: 39160092
<?php
$date="2013-05-14";
echo date('Y-m-d', strtotime('+1 day', strtotime($date)));
?>

Open in new window

0
 
LVL 34

Assisted Solution

by:gr8gonzo
gr8gonzo earned 100 total points
ID: 39160119
You can eliminate the second strtotime() call by just adding 86,400 seconds (the total # of seconds in a day):

$tomorrow = date("Y-m-d",strtotime("2013-05-13")+86400);
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 200 total points
ID: 39160121
That will not work for daylight savings
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 100 total points
ID: 39160148
One more time... It's all in this article that I keep encouraging you to read!

See http://www.laprbass.com/RAY_temp_rgb192.php

<?php // RAY_temp_rgb192.php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('log_errors',     TRUE);


$date = '2013-05-13';
$plus = date('Y-m-d', strtotime($date . ' + 1 DAY'));
var_dump($date, $plus);

Open in new window

Best regards (and please read that article!!), ~Ray
0
 
LVL 7

Accepted Solution

by:
kshna earned 100 total points
ID: 39160633
you need to use mktime function

http://php.net/manual/en/function.mktime.php
0
 

Author Closing Comment

by:rgb192
ID: 39162433
thanks all and double thanks to Gary about daylight savings
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now