diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/viewertime.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/linden/indra/newview/viewertime.cpp b/linden/indra/newview/viewertime.cpp index 06dd91a..06436b6 100644 --- a/linden/indra/newview/viewertime.cpp +++ b/linden/indra/newview/viewertime.cpp | |||
@@ -47,6 +47,9 @@ ViewerTime* gViewerTime = 0; | |||
47 | // We use statics here for speed reasons | 47 | // We use statics here for speed reasons |
48 | bool ViewerTime::sUse24HourTime = false; | 48 | bool ViewerTime::sUse24HourTime = false; |
49 | bool ViewerTime::sUseUTCTime = false; | 49 | bool ViewerTime::sUseUTCTime = false; |
50 | bool ViewerTime::sUseTimeOffset = false; | ||
51 | S32 ViewerTime::sTimeOffset = 0; | ||
52 | bool ViewerTime::sTimeOffsetDST = false; | ||
50 | 53 | ||
51 | std::vector<std::string> ViewerTime::sDays; | 54 | std::vector<std::string> ViewerTime::sDays; |
52 | std::vector<std::string> ViewerTime::sMonths; | 55 | std::vector<std::string> ViewerTime::sMonths; |
@@ -87,16 +90,21 @@ void ViewerTime::refresh() | |||
87 | // There's only one internal tm buffer. | 90 | // There's only one internal tm buffer. |
88 | struct tm* internal_time; | 91 | struct tm* internal_time; |
89 | 92 | ||
90 | if (!sUseUTCTime) | 93 | if (sUseUTCTime) |
91 | { | 94 | { |
92 | // Convert to Pacific, based on server's opinion of whether | 95 | time(&utc_time); |
93 | // it's daylight savings time there. | 96 | internal_time = gmtime(&utc_time); |
94 | internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); | 97 | } |
98 | else if (sUseTimeOffset) | ||
99 | { | ||
100 | //Its a UTC offset, deal with it | ||
101 | internal_time = utc_to_offset_time(utc_time, sTimeOffset, sTimeOffsetDST); | ||
95 | } | 102 | } |
96 | else | 103 | else |
97 | { | 104 | { |
98 | time(&utc_time); | 105 | // Convert to Pacific, based on server's opinion of whether |
99 | internal_time = gmtime(&utc_time); | 106 | // it's daylight savings time there. |
107 | internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); | ||
100 | } | 108 | } |
101 | 109 | ||
102 | mMinute = internal_time->tm_min; | 110 | mMinute = internal_time->tm_min; |