Home > Back-end >  PostgreSQL - how to convert timestamp with timezone to timestamp without timezone
PostgreSQL - how to convert timestamp with timezone to timestamp without timezone

Time:05-19

In my PostgreSQL database, the datetime stored as 2022-05-10 10:44:19 08 and when I get the datetime by using the sequelize, it will give in format:: 2022-05-10T02:44:19.000Z.

So, my question is how to convert to 2022-05-10 10:44:19 ?

Thanks in advance.

CodePudding user response:

I guess that's the answer you looking for: Is there a simple way to make Sequelize return it's date/time fields in a particular format?

CodePudding user response:

There is a direct dependence on the time of your server. Therefore, depending on what you want to get, you can use different options. Here is a dbfiddle with examples

  • Related