PDA

View Full Version : Oracle Date Display Question



dave1178
6 May 2009, 12:56 AM
Hi,

I want to know how to display a correct date in Ext.grid.GridPanel when using JSONArray.fromObject?

The JSONArray returns the following values:

[{"posttime":{"date":6,"day":3,"hours":0,"minutes":0,"month":4,"nanos":0,"seconds":0,"time":1241539200000,"timezoneOffset":-480,"year":109}}]

I want to show the posttime as "2009/5/6", but the JSONArray splits into several parts, is it possible to show it correctly?

The backend is Oracle

Thanks

6 May 2009, 2:34 AM
why not use todate in your sql?

mystix
9 May 2009, 9:50 AM
you could try casting your sql date object to a string and returning that instead.

here's how i do it in PostgreSQL:


SELECT somedate::text AS somedatestring -- returns a date string of the form Y-m-d H:i:s
FROM sometable
WHERE somecondition = true;


you'll need to find out the oracle equivalent of doing that.