简体   繁体   中英

SQL datetime format conversion

I should somehow convert data type to easily insert into table with datetime format. From

2022-11-28T12:18:46.534919023Z

To 2022-11-28 12:18:46

BTW using PostgreSQL. Any ideas how to do it?

SELECT CAST( '2022-11-28T12:18:46.534919023Z' AS timestamp)

结果

More about CAST PostgreSQL CAST

There is no conversion necessary. The indicated value 2022-11-28T12:18:46.534919023Z can be directly inserted into a timestamp with time zone (timestamptz) column. See demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM