0
|
1 |
/*
|
|
2 |
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __DATETIMECONVERTER_H__
|
|
20 |
#define __DATETIMECONVERTER_H__
|
|
21 |
|
|
22 |
#include <e32std.h>
|
|
23 |
|
|
24 |
//
|
|
25 |
// class TDateTimeConverter
|
|
26 |
//
|
|
27 |
// Converts between Win32 time and Symbian OS time
|
|
28 |
//
|
|
29 |
class TDateTimeConverter
|
|
30 |
{
|
|
31 |
public:
|
|
32 |
|
|
33 |
TDateTimeConverter(TUint32 aWinTimeDate);
|
|
34 |
TDateTimeConverter(TDateTime aEpocTimeDate);
|
|
35 |
|
|
36 |
TUint32 GetWinTimeDate();
|
|
37 |
TDateTime GetEpocTimeDate();
|
|
38 |
|
|
39 |
private:
|
|
40 |
|
|
41 |
union TWinTimeDate
|
|
42 |
{
|
|
43 |
struct
|
|
44 |
{
|
|
45 |
unsigned day:5;
|
|
46 |
unsigned month:4;
|
|
47 |
unsigned year:7;
|
|
48 |
unsigned second:5;
|
|
49 |
unsigned minute:6;
|
|
50 |
unsigned hour:5;
|
|
51 |
} t;
|
|
52 |
|
|
53 |
TUint32 winTimeDate;
|
|
54 |
|
|
55 |
} iWinTimeDate;
|
|
56 |
|
|
57 |
TDateTime iEpocTimeDate;
|
|
58 |
};
|
|
59 |
|
|
60 |
#endif // __DATETIMECONVERTER_H__
|