Jump to content

inserting date and time


antilectual

Recommended Posts

on my news manager i have been using CURDATE() to insert the date on which a news item was posted, but now i have changed the column from date to datetime (YYYY-MM-DD HH:MM:ss) and curdate() will not enter the time. is there something else i can use? what does timestamp() do?

this is my query at the moment:

 

"INSERT INTO News SET NewsTitle=\'$title\',

                 NewsDate=CURDATE(),

                 UserID=$user_id,

                 NewsText=\'$text\'";

any ideas?

cheers,

Antilectual

Link to comment
https://forums.phpfreaks.com/topic/1367-inserting-date-and-time/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.