summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lldate.cpp7
-rw-r--r--indra/llcommon/llstring.cpp6
2 files changed, 12 insertions, 1 deletions
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index a7ef28b431..04583cdd4a 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -121,7 +121,12 @@ std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
// use strftime() as it appears to be faster than std::time_put
char buffer[128];
strftime(buffer, 128, fmt.c_str(), gmt);
- return std::string(buffer);
+ std::string res(buffer);
+#if LL_WINDOWS
+ // Convert from locale-dependant charset to UTF-8 (EXT-8524).
+ res = ll_convert_string_to_utf8_string(res);
+#endif
+ return res;
}
void LLDate::toStream(std::ostream& s) const
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 2693c0e22b..faf7aa51f1 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -758,6 +758,7 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31
+ datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02
@@ -1127,6 +1128,11 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
replacement = LLStringOps::sDayFormat;
LLStringUtil::format(replacement, args);
}
+ else if (code == "%-d")
+ {
+ struct tm * gmt = gmtime (&loc_seconds);
+ replacement = llformat ("%d", gmt->tm_mday); // day of the month without leading zero
+ }
else if( !LLStringOps::sAM.empty() && !LLStringOps::sPM.empty() && code == "%p" )
{
struct tm * gmt = gmtime (&loc_seconds);