Go back to always using the local timezone for now - not all machines have US/Pacific or Olsen Amercia/Los_Angeles and this introduces variability that the server operator cannot control

Please see http://opensimulator.org/mantis/view.php?id=5972 soon for more comments.
0.7.4.1
Justin Clark-Casey (justincc) 2012-04-24 23:00:50 +01:00
parent ef1668adb3
commit 54d5ff6774
1 changed files with 18 additions and 13 deletions

View File

@ -351,21 +351,26 @@ namespace OpenSim.Services.LLLoginService
{ {
TimeZoneInfo gridTimeZone; TimeZoneInfo gridTimeZone;
try // Disabled for now pending making timezone a config value, which can at some point have a default of
{ // a ; separated list of possible timezones.
// First try to fetch DST from Pacific Standard Time, because this is // The problem here is that US/Pacific (or even the Olsen America/Los_Angeles) is not universal across
// the one expected by the viewer. "US/Pacific" is the string to search // windows, mac and various distributions of linux, introducing another element of consistency.
// on linux and mac, and should work also on Windows (to confirm) // The server operator needs to be able to control this setting
gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific"); // try
} // {
catch (Exception e) // // First try to fetch DST from Pacific Standard Time, because this is
{ // // the one expected by the viewer. "US/Pacific" is the string to search
m_log.WarnFormat( // // on linux and mac, and should work also on Windows (to confirm)
"[TIMEZONE]: {0} Falling back to system time. System time should be set to Pacific Standard Time to provide the expected time", // gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific");
e.Message); // }
// catch (Exception e)
// {
// m_log.WarnFormat(
// "[TIMEZONE]: {0} Falling back to system time. System time should be set to Pacific Standard Time to provide the expected time",
// e.Message);
gridTimeZone = TimeZoneInfo.Local; gridTimeZone = TimeZoneInfo.Local;
} // }
DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";