Home Postgres SQL Date conversion
Reply: 0

Postgres SQL Date conversion

user527 Published in June 21, 2018, 8:44 am

I have a field stored as timestamp without time zone which looks like this 2017-12-26 06:56:54.958. When I convert it like this:

to_char(date_field, 'DD/MM/YYYY hh24:mm:ss')

I end up with 26/12/2017 06:12:54. Does anybody know why? And if so, is there a way around this. As you can see, 44 minutes are removed from the date giving a time of 06:12 rather than 06:56.

I have tried to convert to UTC and GMT but I have had no luck. Any help would be greatly appreciated.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308842 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO