How to output time instead of date in oracle?

Member

by denis , in category: MySQL , 9 months ago

How to output time instead of date in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by cali_green , 9 months ago

@denis 

To output time instead of date in Oracle, you can use the TO_CHAR function to format a date column or expression as a time value.


For example, you can use the following query to select the current time in Oracle:

1
2
SELECT TO_CHAR(SYSDATE, 'HH24:MI:SS') AS current_time
FROM dual;


This query will return the current time in the format HH24:MI:SS (24-hour clock with hours, minutes, and seconds). You can customize the format string in the TO_CHAR function to display the time in a different format as needed.

Related Threads:

How to add date and time in oracle?
How to get system date and time in oracle sql?
How to take date time difference by milliseconds in oracle?
How to use moment.js instead of new date()?
How to get specific words in an output of oracle query?
How to convert oracle stored procedure output to csv file?