首页 > 代码库 > Flex Date 时区转换

Flex Date 时区转换

项目放到国外服务上时,由于有时区差异,要获得服务器时间就得进行时区转换

private function getTimeZoneFix(fixDate:Date, GMTHour:NUmber = 8):Date{  var gmtDate:Date = new Date(fixDate);   var hourOffset:Number = gmtDate.getTimezoneOffset() / 60 - GMTHour;   gmtDate.setHours(gmtDate.getHours() + hourOffset);   return gmtDate;}