diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2009-10-30 21:28:52 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2009-10-30 21:28:52 -0600 |
commit | 01d06db0154e0cfc43c82664c6bf6129a3fa4883 (patch) | |
tree | 3e842ddedf605d6883be7f04de55c173c38aa46b /indra/llcommon/llstring.cpp | |
parent | 801301c435414df1e22c321a685044b7cd43055e (diff) | |
parent | 9abcf6684e86b0b8c2d343ccd4864b2e854be3d7 (diff) |
sync to the tip.
Diffstat (limited to 'indra/llcommon/llstring.cpp')
-rw-r--r-- | indra/llcommon/llstring.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f2edd5c559..721e5670e7 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -963,30 +963,29 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, // if never fell into those two ifs above, param must be utc if (secFromEpoch < 0) secFromEpoch = 0; - LLDate * datetime = new LLDate((F64)secFromEpoch); + LLDate datetime((F64)secFromEpoch); std::string code = LLStringOps::getDatetimeCode (token); // special case to handle timezone if (code == "%Z") { if (param == "utc") + { replacement = "GMT"; - else if (param == "slt") - replacement = "SLT"; - else if (param != "local") // *TODO Vadim: not local? then what? + } + else if (param == "local") + { + replacement = ""; // user knows their own timezone + } + else + { + // "slt" = Second Life Time, which is deprecated. + // If not utc or user local time, fallback to Pacific time replacement = LLStringOps::getDaylightSavings() ? "PDT" : "PST"; - - return true; - } - replacement = datetime->toHTTPDateString(code); - - if (code.empty()) - { - return false; - } - else - { + } return true; } + replacement = datetime.toHTTPDateString(code); + return !code.empty(); } // LLStringUtil::format recogizes the following patterns. |