Glen,
What version and service pack of ArcGIS Server are you running?
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(); } }
Glenn,
Here is the code in my widget and all esri widgets as well that converts the date returned from REST (which is converted to utc before returned):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(); } }