Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get datetime in 24hour format from oracle database?

Tags:

oracle10g

Is there any other way to get datetime field from oracle database in 24hour format???like -> "select getxsddate(col_name) from tab_name" will get you datetime format as "2012-04-04T12:31:00"...I wanted to know if there are any other ways as i`m not satisfied with this format.

like image 938
palak Avatar asked Apr 04 '12 13:04

palak


People also ask

How do I display a date in 24 hour format in SQL?

In SQL Server 2012, we can use Format function to have suitable date time format. Use capital letter 'HH:mm:ss' for 24 hour date time format.

What is HH24 format?

Hour of day (1-12) HH24. Hour of day (0-23) MI. Minute (0-59)

How do I display a date in YYYY-MM-DD format in Oracle?

Just use: select to_date(date_value, 'yyyy-mm-dd') as date_value from table; To convert to a date. That's it!


1 Answers

select to_char(col_name, 'yyyy-mm-dd hh24:mi:ss') from tab_name 

You can read more about to_char function here

like image 134
Marcin Wroblewski Avatar answered Sep 29 '22 18:09

Marcin Wroblewski