How to retrieve microseconds or milliseconds from MySQL current time?

前端 未结 5 2162
天涯浪人
天涯浪人 2021-01-02 02:17

I am trying to create my first stored function on MySQL. In this function I want to return the timestamp of the current date and time with 3 microsecond digits like this:

5条回答
  •  清歌不尽
    2021-01-02 02:47

    MySQL 5.6 supports the millisecond precision in the sysdate function.

    try

    select sysdate(6) will return 2013-04-16 13:47:56.273434

    and

    select sysdate(3) will return 2013-04-16 13:47:56.273

提交回复
热议问题