internal static DateTime ConvertDoubleToEventDate(double secondsSinceEpoch) { DateTime time = BaseUTCDateTime.AddSeconds(secondsSinceEpoch); int num = time.IsDaylightSavingTime() ? -7 : -8; return(time.AddHours((double)num)); }
//Event dates are stored by assuming the time which the user input was in Pacific // time (PST or PDT, depending on the date), converting that to UTC, and then // converting that to Unix epoch time. This algorithm reverses that process. internal static DateTime ConvertDoubleToEventDate(double secondsSinceEpoch) { var utcDateTime = BaseUTCDateTime.AddSeconds(secondsSinceEpoch); var pacificZoneOffset = utcDateTime.IsDaylightSavingTime() ? -7 : -8; return(utcDateTime.AddHours(pacificZoneOffset)); }
internal static DateTime ConvertDoubleToDate(double secondsSinceEpoch) { return(TimeZone.CurrentTimeZone.ToLocalTime(BaseUTCDateTime.AddSeconds(secondsSinceEpoch))); }