Formatting date from postgresql table in app connect is a pain in the ass.
Regardlesss of whether you set the field type to date,dateTime or timestamp it end up saving as
timestamp with use TimeZone field checked.
Displaying the query will show something like this 2021-10-5T23:59:000Z(Which is the correct time sent to the database) when we try to format it , the date gets converted back to UTC time, searching through the forum i can't seem to find a solution on how to deal with the issue.
the solution i am currently using is
i replace T,Z, and the last .000 with a space and then format the date and it works fine for now
If they are keeping it at current state. They understand 2 things
Converting datetime from any timezone to Utc timezone is very easy
2.Converting from Utc to another timeZone is not straight forward, there is no current wappler way to get the client timezone and there is no formatter to convert datetime to client timezone.
2 things they consider doing is
Create another formatter that can convert datetime to client timezone , with preferred formatting.
Or just let datetime be as is(with the timezone it was inserted) , let users chooose if they want to concert it to Utc timezome if they want.
I don’t remember exactly right now… but its similar to what you are doing.
Removing the Z from datatime on client size using a custom date formatter.
Also, in our project, we keep all date times in DB in UTC, and convert to client’s local time in the UI.
So, if the DB & Node servers are on UTC timezone, there is no additional handling required. But in our case, the Node server was on a different timezone, causing this issue.