Mysql get time string custom function with milliseconds