Solved! Go to Solution.
private var useUTC:Boolean = true; private function getDateLbl(item:Object,column:DataGridColumn):String { var dateMS:Number = Number(item[column.dataField]); var retVal:String = ""; var rVal:String = item[column.dataField]; if(rVal == null) { //do nothing }else{ if (!isNaN(dateMS)) { retVal = msToDate(dateMS, _dateFormat, useUTC); } } return retVal; } private function msToDate(ms:Number, dateFormat:String, useUTC:Boolean):String { var date:Date = new Date(ms); if (date.milliseconds == 999) // workaround for REST bug { date.milliseconds++; } if (useUTC) { date.minutes += date.timezoneOffset; } if (dateFormat) { dateFormatter.formatString = dateFormat; var result:String = dateFormatter.format(date); if (result) { return result; } else { return dateFormatter.error; } } else { return date.toLocaleString(); } }
private var useUTC:Boolean = true; private function getDateLbl(item:Object,column:DataGridColumn):String { var dateMS:Number = Number(item[column.dataField]); var retVal:String = ""; var rVal:String = item[column.dataField]; if(rVal == null) { //do nothing }else{ if (!isNaN(dateMS)) { retVal = msToDate(dateMS, _dateFormat, useUTC); } } return retVal; } private function msToDate(ms:Number, dateFormat:String, useUTC:Boolean):String { var date:Date = new Date(ms); if (date.milliseconds == 999) // workaround for REST bug { date.milliseconds++; } if (useUTC) { date.minutes += date.timezoneOffset; } if (dateFormat) { dateFormatter.formatString = dateFormat; var result:String = dateFormatter.format(date); if (result) { return result; } else { return dateFormatter.error; } } else { return date.toLocaleString(); } }