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

前端 未结 5 1370
野趣味
野趣味 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

    I got the issue resolved. The database was not allowing the insertion of time in millisecond. Please have a look at the lines, below:

    CREATE TABLE MyTimeStamp(TimeData decimal(17,3));
    
    INSERT INTO  MyTimeStamp(TimeData) values (20090922201843.426);
    
    SELECT timestamp(TimeData) FROM MyTimeStamp;
    

    OutPut:

    2009-09-22 20:018:43.426000
    

提交回复
热议问题