2

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.

1 Answer 1

2

Try

to_char(date_field, 'DD/MM/YYYY HH24:MI:SS')

MI is the pattern for minutes. MM is for months, and the case is irrelevant.

Sign up to request clarification or add additional context in comments.

1 Comment

Ahhh...I missed that. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.