I have date in dd/mm/yyyy format. How can I store it in a database, if I want to do some operations on it afterwards?
For example, I must find out the rows, where date > something. What type I must set for the date field?
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.
To store dates or times in MySQL use
date,datetimeortimestamp. I’d recommend the first two for most purposes.To tell MySQL how to parse your date format use the STR_TO_DATE function. Here’s an example:
To format the results back into the original form look at the DATE_FORMAT function. Note that you only need to format it if you want to display it as a string using something other than the default format.