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:
Also you can
mysql> select now(3) as millisecond, now(6) as microsecond, round(1000 * unix_timestamp(now(3))) elapsed_millisecond, round(unix_timestamp() * 1000 + MICROSECOND(now(6)) / 1000) elapsed_microsecond;
+-------------------------+----------------------------+---------------------+---------------------+
| millisecond | microsecond | elapsed_millisecond | elapsed_microsecond |
+-------------------------+----------------------------+---------------------+---------------------+
| 2019-12-10 11:49:43.568 | 2019-12-10 11:49:43.568767 | 1575949783568 | 1575949783569 |
+-------------------------+----------------------------+---------------------+---------------------+
1 row in set (0.01 sec)