:: Forum >>

Unix Timestamp

Hello all!

I found an example from last year for converting and showing unix time() formated date in a grid.

Am brand new at this and am using 2.02

Here is what I have that has no effect on my date. I am sure it is something stupid I am missing as they didn't show a full example. They got up to the end and then stopped short as they both understood each other ;)

The idea is that unix time() is same as js but in seconds not ms so number is times 1000

My date is the 4th column

Here is my code;

// Unix date conversion
var uxdate = new AW.Formats.Date;
uxdate.dataToValue = function(d){return Number(d)*1000};
uxdate.setTextFormat("dd/mmm/yy hh:mm:ss");

// this is where they stopped, next line is my attempt.
obj.setCellFormat(uxdate, 3);

Can anyone help fill in the missing steps to format my unix time?

Thank you!
Monday, September 17, 2007
Here is the orig post:

Monday, September 17, 2007
correction on post link, sorry

Monday, September 17, 2007
Your code is correct. Should work (or the problem is somewhere else).
Alex (ActiveWidgets)
Tuesday, September 18, 2007
The problem WAS in fact elsewhere and I had tried too many changes at once.

The code above DOES work great.

Thanks Alex!
Tuesday, September 18, 2007

This topic is archived.

Back to support forum

Forum search