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

随声附和 提交于 2020-01-12 02:50:33

问题


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.


回答1:


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

You can read more about to_char function here




回答2:


Another very simple way is to set, in the database nls parameters, the parameter date_format='DD-MM-YYYY HH24:MI:SS'



来源:https://stackoverflow.com/questions/10011935/how-to-get-datetime-in-24hour-format-from-oracle-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!