PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
djlex1928
Forum Commoner
Posts: 31 Joined: Sun Sep 19, 2010 3:23 pm
Post
by djlex1928 » Sat Nov 27, 2010 8:55 am
Hi,
Just wondering if there is a standard PHP function to acheive the following, or do I need to write a lengthy function myself?
Code: Select all
<?php
$datebefore = "2010-11-28";
$dateafter = imaginaryfunction($datebefore, 7); //Adds 7 days to the date
echo $dateafter; //Output: 2010-12-05
?>
s992
Forum Contributor
Posts: 124 Joined: Wed Oct 27, 2010 3:06 pm
Post
by s992 » Sat Nov 27, 2010 1:36 pm
szabizs
Forum Newbie
Posts: 2 Joined: Sat Nov 27, 2010 5:33 am
Post
by szabizs » Sun Nov 28, 2010 12:43 pm
Mmm, just today did something like this
Code: Select all
$con = "SELECT * FROM yourTable";
$result = mysql_query($con) or die(mysql_error());
$t1 = date("Y-m-d", strtotime($row['ts'] ."+7 days" ));