0

How Convert the time 16:00:00 or 08:00:00 HH12:MI AM format in oracle query

I try TO_CHAR ('16:00:00', 'HH12:MI AM') but it shows no AM / PM .

Please check

1 Answer 1

3

Well, it works fine:

select to_char(to_date('16:00:00', 'hh24:mi:ss'), 'hh12:mi am') from dual;

The result is:

04:00 pm

Isn't it what you want?

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

1 Comment

Correct. TO_CHAR() expects a date (or a number) not a string.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.