PDA

View Full Version : How to render Epoch time within DateColumn



whippersnapper
26 May 2010, 9:06 AM
Hi. Does Ext have some sort of a Epoch time converter? I have a webservice that publishes a field in Epoch format. I need to convert it to a more readable format and render to the DateColumn Grid.

Eugen_
26 May 2010, 10:02 AM
Hi. Does Ext have some sort of a Epoch time converter? I have a webservice that publishes a field in Epoch format. I need to convert it to a more readable format and render to the DateColumn Grid.
Epoch format is the Unix time (http://en.wikipedia.org/wiki/Unix_time)?



Q: What can I do if the format of my date field on a server is unix timestamp?
A: You need to set the dateFormat property of your field to 'timestamp'.

What is a timestamp? It is the number of seconds since the beginning of the Unix Epoch. So, you can use dateFormat: 'U' as specified in the list of currently supported formats in the Date (http://www.facebook.com/note_redirect.php?note_id=127838923898744&h=c660644fa5e370ea0c956c07c337a151&url=http%3A%2F%2Fwww.extjs.com%2Fdeploy%2Fdev%2Fdocs%2F%3Fclass%3DDate) class, too.

Eugen_
26 May 2010, 10:10 AM
Hi. Does Ext have some sort of a Epoch time converter? I have a webservice that publishes a field in Epoch format. I need to convert it to a more readable format and render to the DateColumn Grid.
Hi whippersnapper,
Epoch time is the Unix time (http://en.wikipedia.org/wiki/Unix_time)?



Q: What can I do if the format of my date field on a server is unix timestamp?
A: You need to set the dateFormat property of your field to 'timestamp'.

What is a timestamp? It is the number of seconds since the beginning of the Unix Epoch. So, you can use dateFormat: 'U' as specified in the list of currently supported formats in the Date (http://www.facebook.com/note_redirect.php?note_id=127838923898744&h=c660644fa5e370ea0c956c07c337a151&url=http%3A%2F%2Fwww.extjs.com%2Fdeploy%2Fdev%2Fdocs%2F%3Fclass%3DDate) class, too.

bee
16 Sep 2011, 5:43 PM
can u tell me how to set up time format.. for timefield.. My thread is http://www.sencha.com/forum/showthread.php?147432-Need-help-on-time-format-for-time-field-xtype&p=649817#post649817