英文:
In PostgreSQL How To find UTC date time from other time zone date time
问题
I have IST date time, I need to find UTC time & date from IST date in PostgreSQL.
At '2023-01-06T16:35:21.628+11:00' this time what was the UTC time I need to find. this time is as per IST time zone.
I am new in PostgreSQL.
英文:
I have IST date time, I need to find UTC time & date from IST date in PostgreSQL.
At '2023-01-06T16:35:21.628+11:00' this time what was the UTC time I need to find. this time is as per IST time zone.
I am new in PostgreSQL.
答案1
得分: 1
UTC时间和日期由以下代码给出:
SELECT '2023-01-06T16:35:21.628+11:00' :: timestamp with time zone AT time zone 'utc'
UTC日期由以下代码给出:
SELECT ('2023-01-06T16:35:21.628+11:00' :: timestamp with time zone AT time zone 'utc') :: date
UTC时间由以下代码给出:
SELECT ('2023-01-06T16:35:21.628+11:00' :: timestamp with time zone AT time zone 'utc') :: time
查看dbfiddle。
英文:
UTC time & date is given by :
SELECT '2023-01-06T16:35:21.628+11:00' :: timestamp with time zone AT time zone 'utc'
UTC date is given by :
SELECT ('2023-01-06T16:35:21.628+11:00' :: timestamp with time zone AT time zone 'utc') :: date
UTC time is givven by :
SELECT ('2023-01-06T16:35:21.628+11:00' :: timestamp with time zone AT time zone 'utc') :: time
see dbfiddle
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论