Okay, here is my code:
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die (\"Cannot connect to database\");
/* We have now connected, unless you got an error message */
/* Lets post some news ! */
$query = \"INSERT INTO news(title, news, author, date)
echo \"<b>Your entry has been successfully added.</b><p>\";
As you can see, it inserts \"now()\" as the date (which is the current date in MySQL, which I\'m sure you know).
It comes out: 2003-04-09
I need to do two things:
1) Set the GMT offset to -5 (I posted it the 8th here and it says it\'s the 9th)
2) Reformat it to say April 8th, 2003
I\'ve tried using the date_format thing but I can\'t quite get it to work. Could you give me a snippet of code to get it to work properly given my code?
Can't understand how to get date_format to work!
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users