I'm creating a system where users can post future events. They can choose an event date, which enters into the mySQL database in the form YYYY-MM-DD (the default date form in mySQL). I'm trying to grab these dates from mySQL using php, and display it in some nice format. PHP's date function says it needs a timestamp if you are to format a pre-entered date, like so:
date ( string format [, int timestamp])
Unfortunately, I can't seem to find a way to convert YYYY-MM-DD in the mySQL database into an int timestamp form. MySQL says it allows the functions timestamp() and unix_timestamp(), but I get error messages saying PHP doesn't know what those are when trying to use them. The last code I attempted, with the string format and a sample date included, I've copied here:
date ('D, M y',timestamp(2000-03-03))
And of course this doesn't work because PHP doesn't recognize timestamp(). I realize what I'm doing wrong is trying to mix mySQL code and php incorrectly, but I'm not sure how to do it correctly (brand new at this).
Any suggestions?
Thanks,
Jeremy