Which of the method is better to insert current time in mySQL.
PHP: time() in db column type INT(10)
or
MySQL: Now() in db type (datetime)
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The second one is generally better as you don’t need to convert it to a proper datetime before using other MySQL datetime functions on it.