I'm shy and girls don't seem to like me.
Now that the lame attempt at humor is out of the way, my problem....
I insert the current date into my mysql database with this statement (edited out unneccessary fields):
$sql = sprintf ("INSERT INTO articles (datePublished) VALUES (now())"
datePublished is a datetime field. I know the info is getting there correctly because I can view it when I display the field with something like $articleInfo["datePublished"] after a SELECT query. It is there and correct. The problem comes when I try to format it into [mm.dd.yy] format. Using date("[m.d.y]", $articleInfo["datePublished"]) gives me [12.31.69] for some reason. I also tried formatting it in my SELECT statement with the following query:
mysql_query("SELECT *, date_format(\"[%m.%d.%y]\", datePublished) as formatDate FROM articles", $db);
If I use that $articleInfo["formatDate"] just ends up being blank.
Any help would be appreciated. Thanks.
Now that the lame attempt at humor is out of the way, my problem....
I insert the current date into my mysql database with this statement (edited out unneccessary fields):
$sql = sprintf ("INSERT INTO articles (datePublished) VALUES (now())"
datePublished is a datetime field. I know the info is getting there correctly because I can view it when I display the field with something like $articleInfo["datePublished"] after a SELECT query. It is there and correct. The problem comes when I try to format it into [mm.dd.yy] format. Using date("[m.d.y]", $articleInfo["datePublished"]) gives me [12.31.69] for some reason. I also tried formatting it in my SELECT statement with the following query:
mysql_query("SELECT *, date_format(\"[%m.%d.%y]\", datePublished) as formatDate FROM articles", $db);
If I use that $articleInfo["formatDate"] just ends up being blank.
Any help would be appreciated. Thanks.