summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-06-15 11:42:18 +0100
committerAimee Linden <aimee@lindenlab.com>2010-06-15 11:42:18 +0100
commit348d3a6ae56433bdf8265a321c5104da9809e4ef (patch)
treea7ba2f23dca60bf100d3b4ea689218b9d9e7878a /indra/llcommon
parenta43c997d0a7209da7e1b3d42b3e3998498741764 (diff)
parentb3fc9c79f559c84893dede3ce643ac0dfd1f3d65 (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-release
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lldate.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index de7f2ead74..a7ef28b431 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -248,8 +248,27 @@ bool LLDate::fromStream(std::istream& s)
s >> fractional;
seconds_since_epoch += fractional;
}
- c = s.get(); // skip the Z
- if (c != 'Z') { return false; }
+
+ c = s.peek(); // check for offset
+ if (c == '+' || c == '-')
+ {
+ S32 offset_sign = (c == '+') ? 1 : -1;
+ S32 offset_hours = 0;
+ S32 offset_minutes = 0;
+ S32 offset_in_seconds = 0;
+
+ s >> offset_hours;
+
+ c = s.get(); // skip the colon a get the minutes if there are any
+ if (c == ':')
+ {
+ s >> offset_minutes;
+ }
+
+ offset_in_seconds = (offset_hours * 60 + offset_sign * offset_minutes) * 60;
+ seconds_since_epoch -= offset_in_seconds;
+ }
+ else if (c != 'Z') { return false; } // skip the Z
mSecondsSinceEpoch = seconds_since_epoch;
return true;