I have a string like this:
2011-11-11 11:11:11.111111
and I need to insert it in MySql, into a datetime column. But after I insert it, it becomes
2011-11-11 11:11:11
What’s going wrong?
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.
MySql 5.6+ supports fractional seconds in Time Values, while previous versions don’t.
A standard
datetimecolumn will not hold microsecond values, while adatetime(6)will. You can test it in MySql 5.6:If you are not using MySql 5.6+ I would suggest you to use two columns, one for the datetime part, and one for the microseconds: