Abhijeet Gulve
Abhijeet Gulve

Reputation: 869

How to convert the current_timestamp time to 24 hours format in postgresql

I'm trying to convert the time which is timestamp with time zone means using now() or current_timestamp

SELECT TO_CHAR(now()::time, 'HH24:MI:SS') 

current time it return is '06:06:17' but it should return '18:06:17' but it won't return this what might be the cause for this

Upvotes: 2

Views: 11045

Answers (1)

Webdev
Webdev

Reputation: 647

The sql should be :-

SELECT TO_CHAR(now(), 'HH24:MI:SS') 

Upvotes: 3

Related Questions