|
Basic PHP and Objects
Hi,
I consider myself a decent programmer. However, I often run into some problems when I try to learn new things. Right now, I am simply trying to take a date and output in GMT format. To do this, I was at php.net and found the example shown below. However, neither the object style nor the procedural style work for me.
Why is it that my server produces and error for each method?
$date = DateTime::createFromFormat('j-M-Y', '15-Feb-2009');
echo $date->format('Y-m-d');
$date = date_create_from_format('j-M-Y', '15-Feb-2009');
echo date_format($date, 'Y-m-d');
Thanks
|