MySQL Forums
Forum List  »  Newbie

how to insert a date to come ?
Posted by: mathieu
Date: June 10, 2005 07:25AM

Hello,

I'd like to insert the date of upcoming events in a datetime field.
Is it possible to use something like :
INSERT INTO mytable(event,date) values('name',DATE_FORMAT(UNIX_TIMESTAMP(NOW())+3600*24*15,'%Y-%m-%d %h:%i:%s'))

I don't know if date functions can be used in an insert ; and if so, can they be nested ?
Btw, I'm not completely satisfied of such a way of inserting dates to come, but I think it's better to use mysql date functions than to handle date format with php then inserting. Do you know any other way ?

Options: ReplyQuote


Subject
Written By
Posted
how to insert a date to come ?
June 10, 2005 07:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.