diff options
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/llcommon/lltimer.cpp | 6 | ||||
-rw-r--r-- | linden/indra/newview/kowopenregionsettings.cpp | 6 | ||||
-rw-r--r-- | linden/indra/newview/viewertime.cpp | 18 |
3 files changed, 22 insertions, 8 deletions
diff --git a/linden/indra/llcommon/lltimer.cpp b/linden/indra/llcommon/lltimer.cpp index 2d283ec..b825c1e 100644 --- a/linden/indra/llcommon/lltimer.cpp +++ b/linden/indra/llcommon/lltimer.cpp | |||
@@ -529,14 +529,14 @@ struct tm* utc_to_offset_time(time_t utc_time, S32 offset, BOOL DST) | |||
529 | { | 529 | { |
530 | if (DST) | 530 | if (DST) |
531 | { | 531 | { |
532 | //Subtract one then | 532 | //Add one then |
533 | offset--; | 533 | offset++; |
534 | } | 534 | } |
535 | 535 | ||
536 | // We subtract off the PST/PDT offset _before_ getting | 536 | // We subtract off the PST/PDT offset _before_ getting |
537 | // "UTC" time, because this will handle wrapping around | 537 | // "UTC" time, because this will handle wrapping around |
538 | // for 5 AM UTC -> 10 PM PDT of the previous day. | 538 | // for 5 AM UTC -> 10 PM PDT of the previous day. |
539 | utc_time -= offset * MIN_PER_HOUR * SEC_PER_MIN; | 539 | utc_time -= (-1 * offset) * MIN_PER_HOUR * SEC_PER_MIN; |
540 | 540 | ||
541 | // Internal buffer to PST/PDT (see above) | 541 | // Internal buffer to PST/PDT (see above) |
542 | struct tm* internal_time = gmtime(&utc_time); | 542 | struct tm* internal_time = gmtime(&utc_time); |
diff --git a/linden/indra/newview/kowopenregionsettings.cpp b/linden/indra/newview/kowopenregionsettings.cpp index ef14d2a..0c4bb38 100644 --- a/linden/indra/newview/kowopenregionsettings.cpp +++ b/linden/indra/newview/kowopenregionsettings.cpp | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "llfloaterregioninfo.h" | 37 | #include "llfloaterregioninfo.h" |
38 | #include "llfloaterworldmap.h" | 38 | #include "llfloaterworldmap.h" |
39 | #include "llvoiceclient.h" | 39 | #include "llvoiceclient.h" |
40 | #include "viewertime.h" | ||
40 | 41 | ||
41 | //DEBUG includes | 42 | //DEBUG includes |
42 | //#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string | 43 | //#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string |
@@ -150,12 +151,15 @@ class OpenRegionInfoUpdate : public LLHTTPNode | |||
150 | } | 151 | } |
151 | if ( body.has("OffsetOfUTC") ) | 152 | if ( body.has("OffsetOfUTC") ) |
152 | { | 153 | { |
153 | gSavedSettings.setS32("TimeOffset", body["OffsetOfUTC"].asReal()); | 154 | gSavedSettings.setS32("TimeOffset", body["OffsetOfUTC"].asInteger()); |
154 | gSavedSettings.setBOOL("UseTimeOffset", true); | 155 | gSavedSettings.setBOOL("UseTimeOffset", true); |
156 | ViewerTime::sUseTimeOffset = true; | ||
157 | ViewerTime::sTimeOffset = gSavedSettings.getS32("TimeOffset"); | ||
155 | } | 158 | } |
156 | if ( body.has("OffsetOfUTCDST") ) | 159 | if ( body.has("OffsetOfUTCDST") ) |
157 | { | 160 | { |
158 | gSavedSettings.setBOOL("TimeOffsetDST", body["OffsetOfUTCDST"].asInteger() == 1 ? TRUE : FALSE); | 161 | gSavedSettings.setBOOL("TimeOffsetDST", body["OffsetOfUTCDST"].asInteger() == 1 ? TRUE : FALSE); |
162 | ViewerTime::sTimeOffsetDST = gSavedSettings.getBOOL("TimeOffsetDST"); | ||
159 | } | 163 | } |
160 | if ( body.has("RenderWater") ) | 164 | if ( body.has("RenderWater") ) |
161 | { | 165 | { |
diff --git a/linden/indra/newview/viewertime.cpp b/linden/indra/newview/viewertime.cpp index 06436b6..8a65a23 100644 --- a/linden/indra/newview/viewertime.cpp +++ b/linden/indra/newview/viewertime.cpp | |||
@@ -27,7 +27,8 @@ | |||
27 | * COMPLETENESS OR PERFORMANCE. | 27 | * COMPLETENESS OR PERFORMANCE. |
28 | * $/LicenseInfo$ | 28 | * $/LicenseInfo$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <sstream> | ||
31 | #include "llviewerprecompiledheaders.h" | 32 | #include "llviewerprecompiledheaders.h" |
32 | 33 | ||
33 | #include "llappviewer.h" // for gPacificDaylightTime | 34 | #include "llappviewer.h" // for gPacificDaylightTime |
@@ -129,10 +130,19 @@ void ViewerTime::refresh() | |||
129 | if (hour == 0) hour = 12; | 130 | if (hour == 0) hour = 12; |
130 | } | 131 | } |
131 | 132 | ||
132 | mTZ = "PST"; | 133 | if (sUseTimeOffset) |
133 | if (gPacificDaylightTime) | 134 | { |
135 | std::stringstream myString; | ||
136 | myString << "UTC " << sTimeOffset; | ||
137 | mTZ = myString.str(); | ||
138 | } | ||
139 | else | ||
134 | { | 140 | { |
135 | mTZ = "PDT"; | 141 | mTZ = "PST"; |
142 | if (gPacificDaylightTime) | ||
143 | { | ||
144 | mTZ = "PDT"; | ||
145 | } | ||
136 | } | 146 | } |
137 | } | 147 | } |
138 | else // just UTC | 148 | else // just UTC |