Date time functions
Posted: Fri Nov 28, 2008 4:50 am
Hello Guys,
I am working on a project that involves loads of date /time manipulation. And I need to be able to add/sub days/months/years from a date object or string. But I cant find a suitable function that works. i have seen some scripts using the "add_delta_ymd()" function or "date_add()" function, but they both dont seem to work on my apache server(localhost). I was wondering if there's another way or maybe I am doing something wrong.
I am using apache 2.2.8 and php 5.2.6.
sample code
--------------------------------------------------------------
$t = date("Y-m-d");
$next_day = date_add($t, 0, 0, 1);
echo "next_day";
--------------------------------------------------------------
Thanks
I am working on a project that involves loads of date /time manipulation. And I need to be able to add/sub days/months/years from a date object or string. But I cant find a suitable function that works. i have seen some scripts using the "add_delta_ymd()" function or "date_add()" function, but they both dont seem to work on my apache server(localhost). I was wondering if there's another way or maybe I am doing something wrong.
I am using apache 2.2.8 and php 5.2.6.
sample code
--------------------------------------------------------------
$t = date("Y-m-d");
$next_day = date_add($t, 0, 0, 1);
echo "next_day";
--------------------------------------------------------------
Thanks