diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llcommon/lldate.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llcommon/lldate.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/linden/indra/llcommon/lldate.cpp b/linden/indra/llcommon/lldate.cpp index 512b3ee..41a3af3 100644 --- a/linden/indra/llcommon/lldate.cpp +++ b/linden/indra/llcommon/lldate.cpp | |||
@@ -19,7 +19,8 @@ | |||
19 | * There are special exceptions to the terms and conditions of the GPL as | 19 | * There are special exceptions to the terms and conditions of the GPL as |
20 | * it is applied to this Source Code. View the full text of the exception | 20 | * it is applied to this Source Code. View the full text of the exception |
21 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 21 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
22 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 22 | * online at |
23 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
23 | * | 24 | * |
24 | * By copying, modifying or distributing this software, you acknowledge | 25 | * By copying, modifying or distributing this software, you acknowledge |
25 | * that you have read and understood your obligations described above, | 26 | * that you have read and understood your obligations described above, |
@@ -36,9 +37,12 @@ | |||
36 | 37 | ||
37 | #include "apr_time.h" | 38 | #include "apr_time.h" |
38 | 39 | ||
40 | #include <time.h> | ||
39 | #include <iomanip> | 41 | #include <iomanip> |
40 | #include <sstream> | 42 | #include <sstream> |
41 | 43 | ||
44 | #include "lltimer.h" | ||
45 | |||
42 | static const F64 DATE_EPOCH = 0.0; | 46 | static const F64 DATE_EPOCH = 0.0; |
43 | 47 | ||
44 | static const F64 LL_APR_USEC_PER_SEC = 1000000.0; | 48 | static const F64 LL_APR_USEC_PER_SEC = 1000000.0; |
@@ -122,7 +126,7 @@ void LLDate::toHTTPDateStream(std::ostream& s) const | |||
122 | << " GMT"; | 126 | << " GMT"; |
123 | 127 | ||
124 | // RFC 1123 date does not use microseconds | 128 | // RFC 1123 date does not use microseconds |
125 | llinfos << "Date in RFC 1123 format is " << s << llendl; | 129 | //llinfos << "Date in RFC 1123 format is " << s << llendl; |
126 | } | 130 | } |
127 | 131 | ||
128 | void LLDate::toStream(std::ostream& s) const | 132 | void LLDate::toStream(std::ostream& s) const |
@@ -234,6 +238,17 @@ void LLDate::secondsSinceEpoch(F64 seconds) | |||
234 | mSecondsSinceEpoch = seconds; | 238 | mSecondsSinceEpoch = seconds; |
235 | } | 239 | } |
236 | 240 | ||
241 | /* static */ LLDate LLDate::now() | ||
242 | { | ||
243 | // time() returns seconds, we want fractions of a second, which LLTimer provides --RN | ||
244 | return LLDate(LLTimer::getTotalSeconds()); | ||
245 | } | ||
246 | |||
247 | bool LLDate::operator<(const LLDate& rhs) const | ||
248 | { | ||
249 | return mSecondsSinceEpoch < rhs.mSecondsSinceEpoch; | ||
250 | } | ||
251 | |||
237 | std::ostream& operator<<(std::ostream& s, const LLDate& date) | 252 | std::ostream& operator<<(std::ostream& s, const LLDate& date) |
238 | { | 253 | { |
239 | date.toStream(s); | 254 | date.toStream(s); |
@@ -245,3 +260,4 @@ std::istream& operator>>(std::istream& s, LLDate& date) | |||
245 | date.fromStream(s); | 260 | date.fromStream(s); |
246 | return s; | 261 | return s; |
247 | } | 262 | } |
263 | |||