'How to convert Millisecond to date and time using mysql
I have a record on the database duration field = "3600000", i just want to convert that into date and time, how do i do that?
I've tried this
..., SELECT GETDATE(duration) FROM Event ....,
and this
..., SELECT CONVERT(datetime, duration, 101) FROM Event ...,
and this
..., SELECT CONVERT(datetime, duration, ISO) FROM Event ...,
and this
..., SELECT CONVERT(datetime, duration) FROM Event ...,
ive always get ERROR on QUERY
reference https://www.w3schools.com/sql/func_mysql_convert.asp
Solution 1:[1]
Try this
select dateadd (ms,duration,'1900-01-01 00:00:00.000') FROM Event ...,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RegBes |
