summaryrefslogtreecommitdiff
path: root/indra/llcommon/lldate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lldate.cpp')
-rw-r--r--indra/llcommon/lldate.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index 6b4bd0d7ef..ff1b6c5334 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -36,9 +36,12 @@
#include "apr_time.h"
+#include <time.h>
#include <iomanip>
#include <sstream>
+#include "lltimer.h"
+
static const F64 DATE_EPOCH = 0.0;
static const F64 LL_APR_USEC_PER_SEC = 1000000.0;
@@ -122,7 +125,7 @@ void LLDate::toHTTPDateStream(std::ostream& s) const
<< " GMT";
// RFC 1123 date does not use microseconds
- llinfos << "Date in RFC 1123 format is " << s << llendl;
+ //llinfos << "Date in RFC 1123 format is " << s << llendl;
}
void LLDate::toStream(std::ostream& s) const
@@ -239,6 +242,17 @@ bool operator!=(const LLDate& first, const LLDate& second)
return (first.secondsSinceEpoch() != second.secondsSinceEpoch());
}
+/* static */ LLDate LLDate::now()
+{
+ // time() returns seconds, we want fractions of a second, which LLTimer provides --RN
+ return LLDate(LLTimer::getTotalSeconds());
+}
+
+bool LLDate::operator<(const LLDate& rhs) const
+{
+ return mSecondsSinceEpoch < rhs.mSecondsSinceEpoch;
+}
+
std::ostream& operator<<(std::ostream& s, const LLDate& date)
{
date.toStream(s);
@@ -250,3 +264,4 @@ std::istream& operator>>(std::istream& s, LLDate& date)
date.fromStream(s);
return s;
}
+