summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstring.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-10-30 17:54:52 -0400
committerJames Cook <james@lindenlab.com>2009-10-30 17:54:52 -0400
commit1de55a587071c379f8155f300e82dacded68fa27 (patch)
treea1821c6882355422afc2d4f8bec9deea005fae66 /indra/llcommon/llstring.cpp
parent4aee82ad98a94ee8215109f125a899a222c80c60 (diff)
parent59c6dc7ed6be989a9fd7a0688fe6e823d3b68baa (diff)
merge
Diffstat (limited to 'indra/llcommon/llstring.cpp')
-rw-r--r--indra/llcommon/llstring.cpp29
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.