1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <sal/types.h>
40 /****************************************************************************/
42 /****************************************************************************/
45 # pragma pack(push, 8)
46 #elif defined(SAL_OS2)
47 # pragma pack(push, 4)
50 /* Time since Jan-01-1970 */
57 #if defined( SAL_W32) || defined(SAL_OS2)
62 /****************************************************************************/
64 /****************************************************************************/
66 typedef struct _oslDateTime
68 /*----------------------------------------------------------------------*/
69 /** contains the nanoseconds .
71 sal_uInt32 NanoSeconds
;
73 /** contains the seconds (0-59).
77 /*----------------------------------------------------------------------*/
78 /** contains the minutes (0-59).
82 /*----------------------------------------------------------------------*/
83 /** contains the hour (0-23).
87 /*----------------------------------------------------------------------*/
88 /** is the day of month (1-31).
92 /*----------------------------------------------------------------------*/
93 /** is the day of week (0-6 , 0 : Sunday).
97 /*----------------------------------------------------------------------*/
98 /** is the month of year (1-12).
102 /*----------------------------------------------------------------------*/
110 /** Get the current system time as TimeValue.
111 @return false if any error occurs.
113 sal_Bool SAL_CALL
osl_getSystemTime( TimeValue
* pTimeVal
);
116 /** Get the GMT from a TimeValue and fill a struct oslDateTime
117 @param pTimeVal[in] TimeValue
118 @param pDateTime[out] On success it receives a struct oslDateTime
120 @return sal_False if any error occurs else sal_True.
122 sal_Bool SAL_CALL
osl_getDateTimeFromTimeValue( TimeValue
* pTimeVal
, oslDateTime
* pDateTime
);
125 /** Get the GMT from a oslDateTime and fill a TimeValue
126 @param pDateTime[in] oslDateTime
127 @param pTimeVal[out] On success it receives a TimeValue
129 @return sal_False if any error occurs else sal_True.
131 sal_Bool SAL_CALL
osl_getTimeValueFromDateTime( oslDateTime
* pDateTime
, TimeValue
* pTimeVal
);
134 /** Convert GMT to local time
135 @param pSystemTimeVal[in] system time to convert
136 @param pLocalTimeVal[out] On success it receives the local time
138 @return sal_False if any error occurs else sal_True.
140 sal_Bool SAL_CALL
osl_getLocalTimeFromSystemTime( TimeValue
* pSystemTimeVal
, TimeValue
* pLocalTimeVal
);
143 /** Convert local time to GMT
144 @param pLocalTimeVal[in] local time to convert
145 @param pSystemTimeVal[out] On success it receives the system time
147 @return sal_False if any error occurs else sal_True.
149 sal_Bool SAL_CALL
osl_getSystemTimeFromLocalTime( TimeValue
* pLocalTimeVal
, TimeValue
* pSystemTimeVal
);
152 /** Get the value of the global timer
153 @return current timer value in milli seconds
156 sal_uInt32 SAL_CALL
osl_getGlobalTimer(void);
162 #endif /* _OSL_TIME_H_ */