summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltimer.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
commit9db949eec327df4173fde3de934a87bedb0db13c (patch)
treeaeffa0f0e68b1d2ceb74d460cbbd22652c9cd159 /indra/llcommon/lltimer.cpp
parent419e13d0acaabf5e1e02e9b64a07648bce822b2f (diff)
svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated for-fucks-sake-whats-with-these-commit-markers
Diffstat (limited to 'indra/llcommon/lltimer.cpp')
-rw-r--r--indra/llcommon/lltimer.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index af89a09d2f..3d05699cd6 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -429,10 +429,9 @@ BOOL LLTimer::knownBadTimer()
//
///////////////////////////////////////////////////////////////////////////////
-U32 time_corrected()
+time_t time_corrected()
{
- U32 corrected_time = (U32)time(NULL) + gUTCOffset;
- return corrected_time;
+ return time(NULL) + gUTCOffset;
}
@@ -452,27 +451,25 @@ BOOL is_daylight_savings()
}
-struct tm* utc_to_pacific_time(S32 utc_time, BOOL pacific_daylight_time)
+struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time)
{
- time_t unix_time = (time_t)utc_time;
-
S32 pacific_offset_hours;
if (pacific_daylight_time)
{
- pacific_offset_hours = -7;
+ pacific_offset_hours = 7;
}
else
{
- pacific_offset_hours = -8;
+ pacific_offset_hours = 8;
}
// We subtract off the PST/PDT offset _before_ getting
// "UTC" time, because this will handle wrapping around
// for 5 AM UTC -> 10 PM PDT of the previous day.
- unix_time += pacific_offset_hours * MIN_PER_HOUR * SEC_PER_MIN;
+ utc_time -= pacific_offset_hours * MIN_PER_HOUR * SEC_PER_MIN;
// Internal buffer to PST/PDT (see above)
- struct tm* internal_time = gmtime(&unix_time);
+ struct tm* internal_time = gmtime(&utc_time);
/*
// Don't do this, this won't correctly tell you if daylight savings is active in CA or not.