How to insert time 2009-09-22 18:09:37.881 in MYSQL My column type is DateTime

前端 未结 5 1336
野趣味
野趣味 2021-01-06 00:57

How to insert time 2009-09-22 18:09:37.881 in mysql. Actually I can insert and retrieve the time 2009-09-22 18:09:37 in mysql but whenever I am try

5条回答
  •  心在旅途
    2021-01-06 01:27

    Having had a quick scan on the MySQL reference pages here, they seem to suggest that you cannot add milliseconds to a column of type datetime. The direct quote is

    "However, microseconds cannot be stored into a column of any temporal data type. Any microseconds part is discarded."

    This implies that you cannot use Timestamp either.

    Are the miliseconds necessary? Could they be stored in a secondary column and then recombined with the basic datetime upon retrieval?

提交回复
热议问题