'SQL: how to convert timestamp to datetime? [closed]

I need to convert "2022-04-29T07:20:32.727Z" to "2022-04-29 07:20:32". I am quite new to SQL and haven't found the solution.



Solution 1:[1]

You can use cast()

select cast('2022-04-29T07:20:32.727Z' as datetime)
Output
2022-04-29 07:20:32.727

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 Kazi Mohammad Ali Nur