Friday 27 January 2012

How to display TIME is 24hour and 12 hour format?

We use the format clause for this purpose.

SELECT CURRENT_TIME (FORMAT 'HH:MM:SS') ; ---> this gives data in 24 hour format
SELECT CURRENT_TIME (FORMAT 'HH:MM:SSBT); --> this gives time in 12 hour format with AM/PM.

The 'B' represent a blank and 'T' represent 12 HRS FORMAT with AM/PM


No comments:

Post a Comment