mysql date and time auto stamp?
I need to separately insert a Date into one field m_DATE (11-10-2010) and then a time into m_TIME (01:15:03) either 24hr or 12hr with an am/pm. How would I go about doin开发者_C百科g this.
Sorry I don't have any example to work with I know there is Current_Timestamp but that does everything in one field.
Use
select DATE(CURRENT_TIMESTAMP)
for the date part and
select TIME(CURRENT_TIMESTAMP)
for the time part. If you want the date and the time of another timestamp than CURRENT_TIMESTAMP, you pass your own parameter to the above mentioned function.
精彩评论