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

前端 未结 2 1318
慢半拍i
慢半拍i 2021-02-05 03:03

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

相关标签:
2条回答
  • 2021-02-05 03:35
    select to_char(col_name, 'yyyy-mm-dd hh24:mi:ss') from tab_name
    

    You can read more about to_char function here

    0 讨论(0)
  • 2021-02-05 03:41

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

    0 讨论(0)
提交回复
热议问题