Page 1 of 1

help regarding dates

Posted: Thu Feb 12, 2009 2:50 am
by greedyisg00d
Hi I am just new to php I am currently developing an scheduler for meetings,conference etc. I have a $date_from and $date_to variable in my code which is stored in my database.

For example:
Date From:04-Feb-2009
Date To: 08-Feb-2009

My problem is I do not know the logic on how can I retrieve the dates in between (Feb, 5,6,7) and store it in the database. Any idea how it works? Thanks

Re: help regarding dates

Posted: Thu Feb 12, 2009 4:31 am
by susrisha

Code: Select all

 
$date_from = '04-Feb-2009';
$date_to = '08-Feb-2009';
 
$date = strtotime(date("d-M-Y", strtotime($date_from)) . " +1 day");
echo date("d-M-Y",$date);
 
check out this code..
$date will have the next day..