Repost:::auto-Calculate The Date

hi guys…

i’m having a problem to auto-calculate the date…

i mean,how to calculate the day between date?

for example; Jan 26th until Jan 30th = 5 days…

i already try this method, but it still doesn’t calculate it… :-[


<?php

      $date_start = new DateTime('');

      $date_end= new DateTime('');                   

      echo $duration = $date_start->diff($date_end)->days;      

?>

i refered from THIS and also THIS.

i hope anyone can help me to solve this problem…

thank you… :)

You should not repost your topic just because you nobody answered the previous topic. Anyway. Have you tried implementing TIMESTAMP in your application. If not you can look into these tutorials:

http://www.tizag.com/phpT/phpdate.php

http://www.tareeinternet.com/forum/knowledgebase/53-detailed-timestamp-information-tutorial.html

i’m sorry for repost my topic and asked the same stupid question… :(