2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 12:39:52 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 12:39:52 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 12:39:52 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 12:39:52 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 12:39:52 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 12:39:52 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 23:51:59 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_tools.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#define _TOOLS_TIME_CXX
|
|
|
|
|
2011-05-01 07:49:30 +02:00
|
|
|
#if defined( WNT )
|
2011-03-25 23:57:35 +01:00
|
|
|
#include <windows.h>
|
2000-09-18 16:07:07 +00:00
|
|
|
#elif defined UNX
|
|
|
|
#include <unistd.h>
|
2003-03-27 16:05:12 +00:00
|
|
|
#include <limits.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <sys/time.h>
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <time.h>
|
2007-06-27 21:09:28 +00:00
|
|
|
#include <tools/time.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-03-03 16:38:47 +00:00
|
|
|
#if defined(SOLARIS) && defined(__GNUC__)
|
|
|
|
extern long altzone;
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// =======================================================================
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
static sal_Int32 TimeToSec100( const Time& rTime )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
short nSign = (rTime.GetTime() >= 0) ? +1 : -1;
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 nHour = rTime.GetHour();
|
|
|
|
sal_Int32 nMin = rTime.GetMin();
|
|
|
|
sal_Int32 nSec = rTime.GetSec();
|
|
|
|
sal_Int32 n100Sec = rTime.Get100Sec();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Wegen Interal Compiler Error bei MSC, etwas komplizierter
|
|
|
|
// return (n100Sec + (nSec*100) + (nMin*60*100) + (nHour*60*60*100) * nSign);
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 nRet = n100Sec;
|
2000-09-18 16:07:07 +00:00
|
|
|
nRet += nSec*100;
|
|
|
|
nRet += nMin*60*100;
|
|
|
|
nRet += nHour*60*60*100;
|
|
|
|
|
|
|
|
return (nRet * nSign);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
static Time Sec100ToTime( sal_Int32 nSec100 )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
short nSign;
|
|
|
|
if ( nSec100 < 0 )
|
|
|
|
{
|
|
|
|
nSec100 *= -1;
|
|
|
|
nSign = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nSign = 1;
|
|
|
|
|
|
|
|
Time aTime( 0, 0, 0, nSec100 );
|
|
|
|
aTime.SetTime( aTime.GetTime() * nSign );
|
|
|
|
return aTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
// =======================================================================
|
|
|
|
|
|
|
|
Time::Time()
|
|
|
|
{
|
2011-05-01 07:49:30 +02:00
|
|
|
#if defined( WNT )
|
2000-09-18 16:07:07 +00:00
|
|
|
SYSTEMTIME aDateTime;
|
|
|
|
GetLocalTime( &aDateTime );
|
|
|
|
|
|
|
|
// Zeit zusammenbauen
|
2004-06-17 12:11:02 +00:00
|
|
|
nTime = (((sal_Int32)aDateTime.wHour)*1000000) +
|
|
|
|
(((sal_Int32)aDateTime.wMinute)*10000) +
|
|
|
|
(((sal_Int32)aDateTime.wSecond)*100) +
|
|
|
|
((sal_Int32)aDateTime.wMilliseconds/10);
|
2000-09-18 16:07:07 +00:00
|
|
|
#else
|
|
|
|
time_t nTmpTime;
|
|
|
|
struct tm aTime;
|
|
|
|
|
|
|
|
// Zeit ermitteln
|
|
|
|
nTmpTime = time( 0 );
|
|
|
|
|
|
|
|
// Zeit zusammenbauen
|
|
|
|
if ( localtime_r( &nTmpTime, &aTime ) )
|
|
|
|
{
|
2004-06-17 12:11:02 +00:00
|
|
|
nTime = (((sal_Int32)aTime.tm_hour)*1000000) +
|
|
|
|
(((sal_Int32)aTime.tm_min)*10000) +
|
|
|
|
(((sal_Int32)aTime.tm_sec)*100);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
nTime = 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2003-07-16 16:15:04 +00:00
|
|
|
Time::Time( const Time& rTime )
|
|
|
|
{
|
|
|
|
nTime = rTime.nTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
Time::Time( sal_uIntPtr nHour, sal_uIntPtr nMin, sal_uIntPtr nSec, sal_uIntPtr n100Sec )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Zeit normalisieren
|
|
|
|
nSec += n100Sec / 100;
|
|
|
|
n100Sec = n100Sec % 100;
|
|
|
|
nMin += nSec / 60;
|
|
|
|
nSec = nSec % 60;
|
|
|
|
nHour += nMin / 60;
|
|
|
|
nMin = nMin % 60;
|
|
|
|
|
|
|
|
// Zeit zusammenbauen
|
2004-06-17 12:11:02 +00:00
|
|
|
nTime = (sal_Int32)(n100Sec + (nSec*100) + (nMin*10000) + (nHour*1000000));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
void Time::SetHour( sal_uInt16 nNewHour )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
short nSign = (nTime >= 0) ? +1 : -1;
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 nMin = GetMin();
|
|
|
|
sal_Int32 nSec = GetSec();
|
|
|
|
sal_Int32 n100Sec = Get100Sec();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
nTime = (n100Sec + (nSec*100) + (nMin*10000) +
|
2004-06-17 12:11:02 +00:00
|
|
|
(((sal_Int32)nNewHour)*1000000)) * nSign;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
void Time::SetMin( sal_uInt16 nNewMin )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
short nSign = (nTime >= 0) ? +1 : -1;
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 nHour = GetHour();
|
|
|
|
sal_Int32 nSec = GetSec();
|
|
|
|
sal_Int32 n100Sec = Get100Sec();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// kein Ueberlauf
|
|
|
|
nNewMin = nNewMin % 60;
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
nTime = (n100Sec + (nSec*100) + (((sal_Int32)nNewMin)*10000) +
|
2000-09-18 16:07:07 +00:00
|
|
|
(nHour*1000000)) * nSign;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
void Time::SetSec( sal_uInt16 nNewSec )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-06-17 12:11:02 +00:00
|
|
|
short nSign = (nTime >= 0) ? +1 : -1;
|
|
|
|
sal_Int32 nHour = GetHour();
|
|
|
|
sal_Int32 nMin = GetMin();
|
|
|
|
sal_Int32 n100Sec = Get100Sec();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// kein Ueberlauf
|
|
|
|
nNewSec = nNewSec % 60;
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
nTime = (n100Sec + (((sal_Int32)nNewSec)*100) + (nMin*10000) +
|
2000-09-18 16:07:07 +00:00
|
|
|
(nHour*1000000)) * nSign;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
void Time::Set100Sec( sal_uInt16 nNew100Sec )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-06-17 12:11:02 +00:00
|
|
|
short nSign = (nTime >= 0) ? +1 : -1;
|
|
|
|
sal_Int32 nHour = GetHour();
|
|
|
|
sal_Int32 nMin = GetMin();
|
|
|
|
sal_Int32 nSec = GetSec();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// kein Ueberlauf
|
|
|
|
nNew100Sec = nNew100Sec % 100;
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
nTime = (((sal_Int32)nNew100Sec) + (nSec*100) + (nMin*10000) +
|
2000-09-18 16:07:07 +00:00
|
|
|
(nHour*1000000)) * nSign;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 Time::GetMSFromTime() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-06-17 12:11:02 +00:00
|
|
|
short nSign = (nTime >= 0) ? +1 : -1;
|
|
|
|
sal_Int32 nHour = GetHour();
|
|
|
|
sal_Int32 nMin = GetMin();
|
|
|
|
sal_Int32 nSec = GetSec();
|
|
|
|
sal_Int32 n100Sec = Get100Sec();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
return (((nHour*3600000)+(nMin*60000)+(nSec*1000)+(n100Sec*10))*nSign);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2004-06-17 12:11:02 +00:00
|
|
|
void Time::MakeTimeFromMS( sal_Int32 nMS )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
short nSign;
|
|
|
|
if ( nMS < 0 )
|
|
|
|
{
|
|
|
|
nMS *= -1;
|
|
|
|
nSign = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nSign = 1;
|
|
|
|
|
|
|
|
Time aTime( 0, 0, 0, nMS/10 );
|
|
|
|
SetTime( aTime.GetTime() * nSign );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2001-06-11 16:17:46 +00:00
|
|
|
|
|
|
|
double Time::GetTimeInDays() const
|
|
|
|
{
|
|
|
|
short nSign = (nTime >= 0) ? +1 : -1;
|
|
|
|
double nHour = GetHour();
|
|
|
|
double nMin = GetMin();
|
|
|
|
double nSec = GetSec();
|
|
|
|
double n100Sec = Get100Sec();
|
|
|
|
|
|
|
|
return (nHour+(nMin/60)+(nSec/(60*60))+(n100Sec/(60*60*100))) / 24 * nSign;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2003-07-16 16:15:04 +00:00
|
|
|
|
|
|
|
Time& Time::operator =( const Time& rTime )
|
|
|
|
{
|
|
|
|
nTime = rTime.nTime;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
Time& Time::operator +=( const Time& rTime )
|
|
|
|
{
|
|
|
|
nTime = Sec100ToTime( TimeToSec100( *this ) +
|
|
|
|
TimeToSec100( rTime ) ).GetTime();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Time& Time::operator -=( const Time& rTime )
|
|
|
|
{
|
|
|
|
nTime = Sec100ToTime( TimeToSec100( *this ) -
|
|
|
|
TimeToSec100( rTime ) ).GetTime();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Time operator +( const Time& rTime1, const Time& rTime2 )
|
|
|
|
{
|
|
|
|
return Sec100ToTime( TimeToSec100( rTime1 ) +
|
|
|
|
TimeToSec100( rTime2 ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Time operator -( const Time& rTime1, const Time& rTime2 )
|
|
|
|
{
|
|
|
|
return Sec100ToTime( TimeToSec100( rTime1 ) -
|
|
|
|
TimeToSec100( rTime2 ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_Bool Time::IsEqualIgnore100Sec( const Time& rTime ) const
|
2002-04-15 09:58:58 +00:00
|
|
|
{
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 n1 = (nTime < 0 ? -Get100Sec() : Get100Sec() );
|
|
|
|
sal_Int32 n2 = (rTime.nTime < 0 ? -rTime.Get100Sec() : rTime.Get100Sec() );
|
2002-04-15 09:58:58 +00:00
|
|
|
return (nTime - n1) == (rTime.nTime - n2);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
Time Time::GetUTCOffset()
|
|
|
|
{
|
2011-05-01 07:49:30 +02:00
|
|
|
#if defined( WNT )
|
2000-09-18 16:07:07 +00:00
|
|
|
TIME_ZONE_INFORMATION aTimeZone;
|
|
|
|
aTimeZone.Bias = 0;
|
|
|
|
DWORD nTimeZoneRet = GetTimeZoneInformation( &aTimeZone );
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 nTempTime = aTimeZone.Bias;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( nTimeZoneRet == TIME_ZONE_ID_STANDARD )
|
|
|
|
nTempTime += aTimeZone.StandardBias;
|
|
|
|
else if ( nTimeZoneRet == TIME_ZONE_ID_DAYLIGHT )
|
|
|
|
nTempTime += aTimeZone.DaylightBias;
|
2010-07-29 10:56:19 +08:00
|
|
|
Time aTime( 0, (sal_uInt16)Abs( nTempTime ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( nTempTime > 0 )
|
|
|
|
aTime = -aTime;
|
|
|
|
return aTime;
|
|
|
|
#else
|
2010-07-29 10:56:19 +08:00
|
|
|
static sal_uIntPtr nCacheTicks = 0;
|
2004-06-17 12:11:02 +00:00
|
|
|
static sal_Int32 nCacheSecOffset = -1;
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uIntPtr nTicks = Time::GetSystemTicks();
|
2000-09-18 16:07:07 +00:00
|
|
|
time_t nTime;
|
|
|
|
tm aTM;
|
2004-06-17 12:11:02 +00:00
|
|
|
sal_Int32 nLocalTime;
|
|
|
|
sal_Int32 nUTC;
|
2000-09-18 16:07:07 +00:00
|
|
|
short nTempTime;
|
|
|
|
|
|
|
|
// Evt. Wert neu ermitteln
|
|
|
|
if ( (nCacheSecOffset == -1) ||
|
|
|
|
((nTicks - nCacheTicks) > 360000) ||
|
|
|
|
( nTicks < nCacheTicks ) // handle overflow
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nTime = time( 0 );
|
|
|
|
localtime_r( &nTime, &aTM );
|
|
|
|
nLocalTime = mktime( &aTM );
|
|
|
|
#if defined( SOLARIS )
|
|
|
|
// Solaris gmtime_r() seems not to handle daylight saving time
|
|
|
|
// flags correctly
|
|
|
|
nUTC = nLocalTime + ( aTM.tm_isdst == 0 ? timezone : altzone );
|
|
|
|
#elif defined( LINUX )
|
|
|
|
// Linux mktime() seems not to handle tm_isdst correctly
|
|
|
|
nUTC = nLocalTime - aTM.tm_gmtoff;
|
|
|
|
#else
|
|
|
|
gmtime_r( &nTime, &aTM );
|
|
|
|
nUTC = mktime( &aTM );
|
|
|
|
#endif
|
|
|
|
nCacheTicks = nTicks;
|
|
|
|
nCacheSecOffset = (nLocalTime-nUTC) / 60;
|
|
|
|
}
|
|
|
|
|
|
|
|
nTempTime = (short)Abs( nCacheSecOffset );
|
2010-07-29 10:56:19 +08:00
|
|
|
Time aTime( 0, (sal_uInt16)nTempTime );
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( nCacheSecOffset < 0 )
|
|
|
|
aTime = -aTime;
|
|
|
|
return aTime;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uIntPtr Time::GetSystemTicks()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-06-19 12:37:38 +00:00
|
|
|
#if defined WNT
|
2010-07-29 10:56:19 +08:00
|
|
|
return (sal_uIntPtr)GetTickCount();
|
2000-09-18 16:07:07 +00:00
|
|
|
#else
|
2003-03-27 16:05:12 +00:00
|
|
|
timeval tv;
|
|
|
|
gettimeofday (&tv, 0);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
double fTicks = tv.tv_sec;
|
2000-09-18 16:07:07 +00:00
|
|
|
fTicks *= 1000;
|
2003-03-27 16:05:12 +00:00
|
|
|
fTicks += ((tv.tv_usec + 500) / 1000);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
fTicks = fmod (fTicks, double(ULONG_MAX));
|
2010-07-29 10:56:19 +08:00
|
|
|
return sal_uIntPtr(fTicks);
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uIntPtr Time::GetProcessTicks()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-06-19 12:37:38 +00:00
|
|
|
#if defined WNT
|
2010-07-29 10:56:19 +08:00
|
|
|
return (sal_uIntPtr)GetTickCount();
|
2000-09-18 16:07:07 +00:00
|
|
|
#else
|
2010-07-29 10:56:19 +08:00
|
|
|
static sal_uIntPtr nImplTicksPerSecond = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
static double dImplTicksPerSecond;
|
|
|
|
static double dImplTicksULONGMAX;
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uIntPtr nTicks = (sal_uIntPtr)clock();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if ( !nImplTicksPerSecond )
|
|
|
|
{
|
|
|
|
nImplTicksPerSecond = CLOCKS_PER_SEC;
|
|
|
|
dImplTicksPerSecond = nImplTicksPerSecond;
|
2010-07-29 10:56:19 +08:00
|
|
|
dImplTicksULONGMAX = (double)(sal_uIntPtr)ULONG_MAX;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double fTicks = nTicks;
|
|
|
|
fTicks *= 1000;
|
|
|
|
fTicks /= dImplTicksPerSecond;
|
|
|
|
fTicks = fmod (fTicks, dImplTicksULONGMAX);
|
2010-07-29 10:56:19 +08:00
|
|
|
return (sal_uIntPtr)fTicks;
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif
|
|
|
|
}
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|