Yii2 Oracle date column
I'm trying to display a table containing date column in Yii2 Framework using GridView widget.
Few specific columns in the oracle table are containing date and time (the rest only date), but when extracting the data by default I only get DD-MM-YYYY, even when running the query in SQL Developer I get the same result, unless I specifically run it with to_char() function.
select to_char(column, 'DD.MM.YYYY HH24:MI:SS') from table;
Will display the full data, I'm fairly new to Oracle databases so I'm unsure how to properly display this in Yii2.
If I use the Yii2 formatter then it formats the date after it retrieves it in DD-MM-YYYY format which will cause the time to be 00:00:00 , instead of the actual time.
Any suggestions?
Thanks!
when running the query in SQL Developer I get the same result, unless I specifically run it with to_char() function.
You should modify date format in SQL Developer so that it displays time component as well; by default, it obviously returns only date. It is (for version 17.4) in Tools - Preferences - Database - NLS - Date format.
Or, as you have noticed, use TO_CHAR with appropriate format mask.
I don't know Yii2 and have no idea how to set date format there, sorry.
链接地址: http://www.djcxy.com/p/36920.html上一篇: Oracle ORA
下一篇: Yii2 Oracle日期列