Reputation: 21905
for example when i execute the following query
select now()::time
the result will be
"10:48:28.421"
so how to get the time with AM/PM ?? (ex. 10:48:28 AM)
NOTE : My computer's location is set to English(United States)
and PostgreSQL Locale is also that
Upvotes: 1
Views: 6549
Reputation: 28403
Try this
Select to_char(now()::Time, 'HH12:MI:SS AM')
Output:
TO_CHAR
05:00:12 AM
Refer Formatting Functions
Upvotes: 5