I have the following in part of my scripts...
$EventDate="19/09/2004";
echo "EventDateFromDB ".$EventDate."<br>";
$EventDate1 = date ("d/M/y",$EventDate);
echo "EventDateFromEventDateInDB ".$EventDate1."<br>";
$EventDate returns 19/09/2004
and EventDate1 should return 19/Sep/2004
It worked fine in php4.x.x but I have upgraded to php5 and it fails.
Any ideas?
ps.
$EventDate actually comes from a datebase call to a record date, but I have given it a static value of 19/09/2004 just for this posting.You might consider switching your system to use UNIX timestamps. Would make things like this non-existant.date() has always required a timestamp for the 2nd parameter.
date("Y/m/d", strtotime("2004-01-01"));
$EventDate="19/09/2004";
echo "EventDateFromDB ".$EventDate."<br>";
$EventDate1 = date ("d/M/y",$EventDate);
echo "EventDateFromEventDateInDB ".$EventDate1."<br>";
$EventDate returns 19/09/2004
and EventDate1 should return 19/Sep/2004
It worked fine in php4.x.x but I have upgraded to php5 and it fails.
Any ideas?
ps.
$EventDate actually comes from a datebase call to a record date, but I have given it a static value of 19/09/2004 just for this posting.You might consider switching your system to use UNIX timestamps. Would make things like this non-existant.date() has always required a timestamp for the 2nd parameter.
date("Y/m/d", strtotime("2004-01-01"));