From 0e3053e4c97670e897496ffa98d7039bf686e6d2 Mon Sep 17 00:00:00 2001 From: Olivier van Helden and Gudule Lapointe (Speculoos.net) Date: Thu, 19 Apr 2012 01:17:56 +0200 Subject: DST settings to match client default Pacific Time (mantis #5972) --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 844c5ae..8fdcf4e 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -349,7 +349,21 @@ namespace OpenSim.Services.LLLoginService private void SetDefaultValues() { - DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; + TimeZoneInfo gridTimeZone; + try + { + // 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 + // on linux and mac, and should work also on Windows (to confirm) + gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific"); + } + 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; + } + DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; + StipendSinceLogin = "N"; Gendered = "Y"; EverLoggedIn = "Y"; -- cgit v1.1 From cbe889e10bc06f0a3e31b4094c88bf022635dff9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Apr 2012 20:30:19 +0100 Subject: minor: formatting changes to top of LLLoginResponse.SetDefaultValues(), chiefly some break up of the long line. --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 8fdcf4e..10a44ed 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -350,6 +350,7 @@ namespace OpenSim.Services.LLLoginService private void SetDefaultValues() { TimeZoneInfo gridTimeZone; + try { // First try to fetch DST from Pacific Standard Time, because this is @@ -359,9 +360,13 @@ namespace OpenSim.Services.LLLoginService } 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); + 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; } + DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; StipendSinceLogin = "N"; -- cgit v1.1