adding days to date
Posted: Tue Mar 16, 2010 10:32 pm
ive got a date stored in a database as 3 different field. YYYY, MM and DD
i did this just as a test hopeing to see it add 2,3,4 days onto the day stored in the database
what i get echoed back
20100326 <---date compiled from whats in the database
19700823 <---no idea
19700824 <---more clueless
19700825 <----- utterly lost
i did this just as a test hopeing to see it add 2,3,4 days onto the day stored in the database
Code: Select all
$querz = "SELECT * FROM event WHERE event_ID = '00000000000000000001' " ;
$resulz = mysql_query($querz, $dbConn) or die ( "Error in query: $query. " . mysql_error() );
$rolt=mysql_fetch_array($resulz);
$compedate = $rolt['event_dateey'].$rolt['event_dateem'].$rolt['event_dateed'];
$NewDate1=Date('Ymd', strtotime("+2 days",$compedate));
$NewDate2=Date('Ymd', strtotime("+3 days",$compedate));
$NewDate3=Date('Ymd', strtotime("+4 days",$compedate));
echo $compedate."<br>";
echo $NewDate1."<br>";
echo $NewDate2."<br>";
echo $NewDate3."<br>";20100326 <---date compiled from whats in the database
19700823 <---no idea
19700824 <---more clueless
19700825 <----- utterly lost