Setup a timestamp field in your database (lets call it posted_on for this example):
Then use NOW()
$query = mysql_query("INSERT INTO table (name, body, posted_on) VALUES('bob', 'hello', NOW())");
NOW() will stamp the timestamp field for you upon INSERTing.
Then use DATE_FORMAT when extracting the timestamp out of the database to manipulate the timestamp to display how you want it. Check the link I sent you for more on DATE_FORMAT, or do a search on these forums. It's a really handy tool.