2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This utility class provides static methods for conversions
15 * between Symbian class types and XSD time-date type
26 #ifndef SEN_DATE_UTILS_H
27 #define SEN_DATE_UTILS_H
35 * This utility class provides static methods for conversions between Symbian
36 * class types and XSD time-date type.
43 enum { KXmlDateTimeMaxLength = 31 };
47 * Convert dateTime (from XML schema) to Symbian TTime.
48 * A panic will occur if an attempt is made to set an invalid
49 * value for any of the fields.
50 * Panics: User 3 if illegal date.
51 * Leave codes: KErrUnderflow Not enough data given or
53 * KErrOverflow Too big values for e.g. month
54 * KErrGeneral Invalid date structure
55 * No check is made upon the validity of the year.
57 * @param aXmlDateTime source datetime to convert from
58 * @return The returned time will be in UTC.
60 IMPORT_C static TTime FromXmlDateTimeL(const TDesC8& aXmlDateTime);
63 * Convert Symbian TTime to dateTime (from XML schema).
64 * Leave codes: KErrOverflow target descriptor is less than
65 * KXmlDateTimeMaxLength (25 bytes)
67 * @param aDest (UTF8) result will be written here. It must be at least
68 * KXmlDateTimeMaxLength long.
69 * @param TTime in UTC.
71 IMPORT_C static void ToXmlDateTimeUtf8L(TDes8& aDest,
75 * Convert Symbian TTime to dateTime (from XML schema).
76 * Leave codes: KErrOverflow target descriptor is less than
77 * KXmlDateTimeMaxLength (25 bytes)
79 * @param aDest (UTF8) result will be written here. It must be at least
80 * KXmlDateTimeMaxLength long.
81 * @param TTime in UTC.
83 IMPORT_C static void ToXmlDateTimeUtf82L(TDes8& aDest, const TTime& aSrc) ;
87 * Hide default C++ constructor.
92 * Prohibit copy constructor if not deriving from CBase.
94 SenDateUtils( const SenDateUtils& );
97 * Prohibit assignment operator if not deriving from CBase.
99 SenDateUtils& operator=( const SenDateUtils& );
102 #endif // SEN_DATE_UTILS_H