package com.zorked { public class DateUtility { public static function ChangeTimezone(dt:Date, timezone:Number):Date { var blnIsDST:Boolean = (dt.getTimezoneOffset() < new Date(2000, 0, 1).getTimezoneOffset()); dt.minutes += dt.getTimezoneOffset(); dt.minutes -= timezone * 60; dt.minutes += blnIsDST ? 60 : 0; return dt; } public static function GetDaysInMonth(month:uint, year:int = -1):uint { if (year == -1) { year = new Date().fullYear; } if (month == 11) { return new Date(year, 0, 0).date; } return new Date(year, month + 1, 0).date; } } }