Merge "remove badge dependency for legacy NotificationManager" into tizen_2.2
[platform/framework/native/appfw.git] / inc / FBaseDateTime.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FBaseDateTime.h
19  * @brief               This is the header file for the %DateTime class.
20  *
21  * This header file contains the declarations of the %DateTime class.
22  */
23 #ifndef _FBASE_DATE_TIME_H_
24 #define _FBASE_DATE_TIME_H_
25
26 #include <FBaseObject.h>
27 #include <FBaseTimeSpan.h>
28 #include <FBaseString.h>
29 #include <FBaseDouble.h>
30
31 namespace Tizen { namespace Base
32 {
33 /**
34  *      @class  DateTime
35  *      @brief  This class represents the date and time as per the Gregorian calendar.
36  *
37  *      @since 2.0
38  *
39  *      The %DateTime class represents dates and times with values ranging from 12:00:00.000 midnight,
40  *      January 1, 1 to 11:59:59.999 P.M., December 31, 9999 in the Gregorian calendar. It
41  *      provides methods for conversion between the time formats.
42  *
43  *      For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/datetime_timespan.htm">DateTime and TimeSpan</a>.
44  *
45  *  The following example demonstrates how to use the %DateTime class.
46
47  *      @code
48  *
49  *      #include <FBase.h>
50  *
51  *      using namespace Tizen::Base;
52  *
53  *      // This method sets both current local time and UTC time.
54  *      void
55  *      MyClass::DateTimeSample(void)
56  *      {
57  *              DateTime dt;
58  *              int year, month, day;
59  *
60  *              dt.SetValue(2009, 10, 25);
61  *
62  *              dt.AddYears(10);
63  *              dt.AddMonths(3);
64  *              dt.AddDays(5);
65  *
66  *              // Gets values
67  *              year = dt.GetYear();            //      2020
68  *              month = dt.GetMonth();          //      1
69  *              day = dt.GetDay();                      //      30
70  *      }
71  *      @endcode
72  */
73 class _OSP_EXPORT_ DateTime
74         : public Object
75 {
76 public:
77         /**
78          *      This is the default constructor for this class.
79          *
80          *      @since 2.0
81          *
82          *      @remarks        The value of the instance is the same as the value of the instance returned by the GetMinValue() method.
83          */
84         DateTime(void);
85
86         /**
87          *      Copying of objects using this copy constructor is allowed.
88          *
89          *      @since 2.0
90          *
91          *      @param[in]  value               The %DateTime instance to copy
92          */
93         DateTime(const DateTime& value);
94
95         /**
96          * This destructor overrides Tizen::Base::Object::~Object().
97          *
98          * @since 2.0
99          */
100         virtual ~DateTime(void);
101
102         /**
103          *      Sets the current instance of %DateTime to the value of the specified instance of TimeSpan since the minimum date (GetMinValue()).
104          *
105          *      @since 2.0
106          *
107          *      @param[in]      value   An instance of TimeSpan
108          *      @exception      E_SUCCESS                       The method is successful.
109          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
110          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
111          *                                                                      is less than the value returned by GetMinValue().
112          */
113         result SetValue(const TimeSpan& value);
114
115         /**
116          *      Sets the current instance of %DateTime to the value of the specified instance of %DateTime.
117          *
118          *      @since 2.0
119          *
120          *      @param[in]      value   An instance of %DateTime
121          */
122         void SetValue(const DateTime& value);
123
124         /**
125          *      Sets the current instance of %DateTime to the specified @c year, @c month, @c day, @c hour, @c minute, and @c second.
126          *
127          *      @since 2.0
128          *
129          *      @return         An error code
130          *      @param[in]      year                            The year to set
131          *      @param[in]      month                           The month to set
132          *      @param[in]      day                                     The day to set
133          *      @param[in]      hour                            The hour to set
134          *      @param[in]      minute                          The minute set
135          *      @param[in]      second                          The second to set
136          *      @exception      E_SUCCESS                       The method is successful.
137          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
138          *                                                                      Either the arguments are greater than the value returned by GetMaxValue() or
139          *                                                                      are less than the value returned by GetMinValue(), or
140          *                                                                      the arguments contain invalid values.
141          *                                                                      For example, day is 31 when month is 2.
142          */
143         result SetValue(int year, int month, int day, int hour = 0, int minute = 0, int second = 0);
144
145         /**
146          *      Sets the current instance of %DateTime to the specified @c year, @c month, @c day, @c hour, @c minute, @c second, and @c millisecond.
147          *
148          *      @since 2.1
149          *
150          *      @return         An error code
151          *      @param[in]      year                            The year to set
152          *      @param[in]      month                           The month to set
153          *      @param[in]      day                                     The day to set
154          *      @param[in]      hour                            The hour to set
155          *      @param[in]      minute                          The minute set
156          *      @param[in]      second                          The second to set
157          *      @param[in]      millisecond                     The millisecond to set
158          *      @exception      E_SUCCESS                       The method is successful.
159          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
160          *                                                                      Either the arguments are greater than the value returned by GetMaxValue() or
161          *                                                                      are less than the value returned by GetMinValue(), or
162          *                                                                      the arguments contain invalid values.
163          *                                                                      For example, day is 31 when month is 2.
164          */
165         result SetValue(int year, int month, int day, int hour, int minute, int second, int millisecond);
166
167         /**
168          *      Sets the current instance of %DateTime with the specified number of %ticks.
169          *      The tick value of type @c long @c long represents dates and times ranging from January 1, 1 A.D. 00:00:00.000 am.
170          *
171          *      @since  2.1
172          *
173          *      @return         An error code
174          *      @param[in]      ticks   The number of ticks
175          *      @exception      E_SUCCESS                       The method is successful.
176          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
177          *                                                                      Either the arguments are greater than the value returned by GetMaxValue() or
178          *                                                                      are less than the value returned by GetMinValue(), or
179          *                                                                      the arguments contain invalid values.
180          *                                                                      For example, day is 31 when month is 2.
181          */
182         result SetValue(long long ticks);
183
184         /**
185          *      Copying of objects using this copy assignment operator is allowed.
186          *
187          *      @since 2.0
188          *
189          *      @return         A reference to the current object
190          *      @param[in]      rhs     An instance of %DateTime
191          */
192         DateTime& operator =(const DateTime& rhs);
193
194         /**
195          *      Checks whether the current instance of %DateTime is equivalent to the specified instance of %DateTime.
196          *
197          *      @since 2.0
198          *
199          *      @return         @c true if the current instance is equivalent to the specified instance, @n
200          *                              else @c false
201          *      @param[in]      rhs     An instance of %DateTime
202          */
203         bool operator ==(const DateTime& rhs) const;
204
205         /**
206          *      Checks whether the current instance of %DateTime is not equivalent to the specified instance of %DateTime.
207          *
208          *      @since 2.0
209          *
210          *      @return         @c true if the current instance is not equivalent to the specified instance, @n
211          *                              else @c false
212          *      @param[in]      rhs     An instance of %DateTime
213          */
214         bool operator !=(const DateTime& rhs) const;
215
216         /**
217          *      Checks whether the value of the current instance of %DateTime is less than the value of the specified instance of %DateTime.
218          *
219          *      @since 2.0
220          *
221          *      @return         @c true if the value of the current instance is less than the value of the specified instance, @n
222          *                              else @c false
223          *      @param[in]      rhs     An instance of %DateTime
224          */
225         bool operator <(const DateTime& rhs) const;
226
227         /**
228          *      Checks whether the value of the current instance of %DateTime is greater than the value of the specified instance of %DateTime.
229          *
230          *      @since 2.0
231          *
232          *      @return         @c true if the value of the current instance is greater than the value of the specified instance, @n
233          *                              else @c false
234          *      @param[in]      rhs     An instance of %DateTime
235          */
236         bool operator >(const DateTime& rhs) const;
237
238         /**
239          *      Checks whether the value of the current instance of %DateTime is less than or equal to the value of the specified instance of %DateTime.
240          *
241          *      @since 2.0
242          *
243          *      @return         @c true if the value of the current instance is less than or equal to the value of the specified instance, @n
244          *                              else @c false
245          *      @param[in]      rhs     An instance of %DateTime
246          */
247         bool operator <=(const DateTime& rhs) const;
248
249         /**
250          *      Checks whether the value of the current instance of %DateTime is greater than or equal to the value of the specified instance of %DateTime.
251          *
252          *      @since 2.0
253          *
254          *      @return         @c true if the value of the current instance is greater than or equal to the value of the specified instance, @n
255          *                              else @c false
256          *      @param[in]      rhs     An instance of %DateTime
257          */
258         bool operator >=(const DateTime& rhs) const;
259
260         /**
261          *      Adds the specified time span to the instance of %DateTime.
262          *
263          *      @since 2.0
264          *
265          *      @return         An error code
266          *      @param[in]      t                                       The time span to add
267          *      @exception      E_SUCCESS                       The method is successful.
268          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
269          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
270          *                                                                      is less than the value returned by GetMinValue().
271          */
272         result Add(const TimeSpan& t);
273
274         /**
275          *      Adds the specified number of days to the instance of %DateTime.
276          *
277          *      @since 2.0
278          *
279          *      @return         An error code
280          *      @param[in]      days                            The number of days to add
281          *      @exception      E_SUCCESS                       The method is successful.
282          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
283          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
284          *                                                                      is less than the value returned by GetMinValue().
285          */
286         result AddDays(int days);
287
288         /**
289          *      Adds the specified number of hours to the instance of %DateTime.
290          *
291          *      @since 2.0
292          *
293          *      @return         An error code
294          *      @param[in]      hours                           The number of hours to add
295          *      @exception      E_SUCCESS                       The method is successful.
296          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
297          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
298          *                                                                      is less than the value returned by GetMinValue().
299          */
300         result AddHours(int hours);
301
302         /**
303          *      Adds the specified number of minutes to the instance of %DateTime.
304          *
305          *      @since 2.0
306          *
307          *      @return         An error code
308          *      @param[in]      minutes                         The number of minutes to add
309          *      @exception      E_SUCCESS                       The method is successful.
310          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
311          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
312          *                                                                      is less than the value returned by GetMinValue().
313          */
314         result AddMinutes(int minutes);
315
316         /**
317          *      Adds the specified number of months to the instance of %DateTime.
318          *
319          *      @since 2.0
320          *
321          *      @return         An error code
322          *      @param[in]      months                          The number of months to add
323          *      @exception      E_SUCCESS                       The method is successful.
324          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
325          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
326          *                                                                      is less than the value returned by GetMinValue().
327          */
328         result AddMonths(int months);
329
330         /**
331          *      Adds the specified number of seconds to the instance of %DateTime.
332          *
333          *      @since 2.0
334          *
335          *      @return         An error code
336          *      @param[in]      seconds                         The number of seconds to add
337          *      @exception      E_SUCCESS                       The method is successful.
338          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
339          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
340          *                                                                      is less than the value returned by GetMinValue().
341          */
342         result AddSeconds(int seconds);
343
344         /**
345          *      Adds a specified number of milliseconds to the instance of %DateTime.
346          *
347          *      @since 2.1
348          *
349          *      @return         An error code
350          *      @param[in]      milliseconds            The number of milliseconds to add
351          *      @exception      E_SUCCESS                       The method is successful.
352          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
353          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
354          *                                                                      is less than the value returned by GetMinValue().
355          */
356         result AddMilliseconds(long long milliseconds);
357
358         /**
359          *      Adds a specified number of ticks to the instance of %DateTime.
360          *
361          *      @since 2.1
362          *
363          *      @return         An error code
364          *      @param[in]      ticks                           The number of ticks to add
365          *      @exception      E_SUCCESS                       The method is successful.
366          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
367          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
368          *                                                                      is less than the value returned by GetMinValue().
369          */
370         result AddTicks(long long ticks);
371
372         /**
373          *      Adds the specified number of years to the instance of %DateTime.
374          *
375          *      @since 2.0
376          *
377          *      @return         An error code
378          *      @param[in]      years                           The number of years to add
379          *      @exception      E_SUCCESS                       The method is successful.
380          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
381          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
382          *                                                                      is less than the value returned by GetMinValue().
383          */
384         result AddYears(int years);
385
386         /**
387          *      Compares two specified instances of %DateTime. @n
388          *      The two instances must be in the same time zone to make a meaningful comparison.
389          *
390          *      @since 2.0
391          *
392          *  @return             A 32-bit @c signed integer value
393          *      @code
394          *      <  0  if the value of @c dt1 is less than the value of @c dt2
395          *      == 0  if the value of @c dt1 is equal to the value of @c dt2
396          *      >  0  if the value of @c dt1 is greater than the value of @c dt2
397          *      @endcode
398          *      @param[in]      dt1     An instance of %DateTime
399          *      @param[in]      dt2     An instance of %DateTime
400          */
401         static int Compare(const DateTime& dt1, const DateTime& dt2);
402
403         /**
404          *      Compares the value of the current instance of %DateTime with the value of the specified instance of %DateTime.
405          *
406          *      @since 2.0
407          *
408          *  @return             A 32-bit @c signed integer value
409          *      @code
410          *      <  0  if the value of the current instance is less than value of the specified instance
411          *      == 0  if the value of the current instance is equal to value of the specified instance
412          *      >  0  if the value of the current instance is greater than value of the specified instance
413          *      @endcode
414          *      @param[in]      value   An instance of %DateTime
415          */
416         int CompareTo(const DateTime& value) const;
417
418         /**
419          *      Checks whether the specified instance of Object is equivalent to the current instance of %DateTime.
420          *
421          *      @since 2.0
422          *
423          *      @return         @c true if the specified instance of Object is equivalent to the current instance of %DateTime, @n
424          *                              else @c false
425          *      @param[in]      obj The object to compare with the current instance of %DateTime
426          *      @see            Tizen::Base::Object::GetHashCode()
427          */
428         virtual bool Equals(const Object& obj) const;
429
430         /**
431          *      Gets the hash value of the current instance of %DateTime. @n
432          *      The hash value is calculated as (GetTime() ^ (GetTime() >> 16)).
433          *
434          *      @since 2.0
435          *
436          *      @return         The hash value of the current instance of %DateTime
437          *      @see            Tizen::Base::Object::Equals()
438          */
439         virtual int GetHashCode(void) const;
440
441         /**
442          *      Gets the time span since the midnight of the date represented by the current instance of %DateTime.
443          *
444          *      @since 2.0
445          *
446          *      @return         An instance of TimeSpan
447          */
448         TimeSpan GetTimeOfDay(void) const;
449
450         /**
451          *      Gets the number of @c days in the specified @c month of the specified @c year.
452          *
453          *      @since 2.0
454          *
455          *      @return         An error code
456          *      @param[in]      year                            The year
457          *      @param[in]      month                           The month
458          *      @param[out]     days                            The number of days
459          *      @exception      E_SUCCESS                       The method is successful.
460          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
461          *                                                                      @c year must be a value between @c 1 and @c 9999 and @c month must be a value between @c 1 and @c 12.
462          */
463         static result GetDaysInMonth(int year, int month, int& days);
464
465         /**
466          *      Subtracts the specified time span from the value of the current instance of %DateTime.
467          *
468          *      @since 2.0
469          *
470          *      @return         An error code
471          *      @param[in]      t                                       The time span to deduct
472          *      @exception      E_SUCCESS                       The method is successful.
473          *      @exception      E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method. @n
474          *                                                                      The resulting value of %DateTime is greater than the value returned by GetMaxValue() or @n
475          *                                                                      is less than the value returned by GetMinValue().
476          */
477         result Subtract(const TimeSpan& t);
478
479         /**
480          *      Represents the current instance of %DateTime as a string.
481          *
482          *      @since 2.0
483          *
484          *      @return         A string containing Unicode representation of the value of the current instance of %DateTime
485          *      @remarks        The format of the String representation is "mm/dd/yyyy hh:mm:ss".
486          *      @remarks        Use the Tizen::Locale namespace for a string of the locale-specific representation.
487          *
488          */
489         String ToString(void) const;
490
491         /**
492          * Parses the specified String representation of the date and time value.
493          *
494          * @since 2.0
495          *
496          * @return              An error code
497          * @param[in]   str             A String representation of a date and time value
498          * @param[out]  dt              The result of the method
499          * @exception   E_SUCCESS                               The method is successful.
500          * @exception   E_INVALID_FORMAT                The specified string is in an invalid format.
501          * @exception   E_OUT_OF_RANGE                  The specified string contains an invalid value. @n
502          *                                                                              1) The resulting value of %DateTime is greater than the value returned by GetMaxValue()
503          *                                                                              or is less than the value returned by GetMinValue(). @n
504          *                                                                              2) The specified string contains an invalid value.
505          *                                                                              For example, day is 31 when the month is 2.
506          * @remarks
507          *                              - The format of the string is "mm/dd/yyyy hh:mm:ss".
508          *                              - This method guarantees that the original value of out-parameter is not changed when the method returns error.
509          */
510         static result Parse(const String& str, DateTime& dt);
511
512         /**
513          *      Gets the year of the current instance of %DateTime.
514          *
515          *      @since 2.0
516          *
517          *      @return         An integer value indicating the year of the current instance of %DateTime
518          */
519         int GetYear(void) const;
520
521         /**
522          *      Gets the month of the current instance of %DateTime.
523          *
524          *      @since 2.0
525          *
526          *      @return         An integer value indicating the month of the current instance of %DateTime
527          */
528         int GetMonth(void) const;
529
530         /**
531          *      Gets the day of the current instance of %DateTime.
532          *
533          *      @since 2.0
534          *
535          *      @return         An integer value indicating the day of the current instance of %DateTime
536          */
537         int GetDay(void) const;
538
539         /**
540          *      Gets the hour of the current instance of %DateTime.
541          *
542          *      @since 2.0
543          *
544          *      @return         An integer value indicating the hour of the current instance of %DateTime
545          */
546         int GetHour(void) const;
547
548         /**
549          *      Gets the minute of the current instance of %DateTime.
550          *
551          *      @since 2.0
552          *
553          *      @return         An integer value indicating the minute of the current instance of %DateTime
554          */
555         int GetMinute(void) const;
556
557         /**
558          *      Gets the second of the current instance of %DateTime.
559          *
560          *      @since 2.0
561          *
562          *      @return         An integer value indicating the second of the current instance of %DateTime
563          */
564         int GetSecond(void) const;
565
566         /**
567          *      Gets the millisecond of the current instance of %DateTime.
568          *
569          *      @since  2.1
570          *
571          *      @return         An integer value indicating the millisecond of the current instance of %DateTime
572          */
573         int GetMillisecond(void) const;
574
575         /**
576          *      Gets the number of ticks in 1 second.
577          *
578          *      @since  2.1
579          *
580          *      @return         The number of ticks in 1 second.
581          */
582         static int GetTicksPerSecond(void);
583
584         /**
585          *      Gets the tick of the current instance of %DateTime.
586          *      The tick value of type @c long @c long represents dates and times ranging from January 1, 1 A.D. 00:00:00.000 am.
587          *
588          *      @since  2.1
589          *
590          *      @return         A @c long @c long value indicating the tick of the current instance of %DateTime
591          */
592         long long GetTicks(void) const;
593
594         /**
595          *      Gets the number of milliseconds (in TimeSpan) since the minimum date (GetMinValue()).
596          *
597          *      @since 2.0
598          *
599          *      @return         An instance of TimeSpan
600          *      @remarks        The returned instance is the time since the value returned by GetMinValue().
601          */
602         TimeSpan GetTime(void) const;
603
604         /**
605          *      Gets the maximum allowable value of %DateTime (that is, "December 31 9999 23:59:59.999").
606          *
607          *      @since 2.0
608          *
609          *      @return         An instance of %DateTime
610          */
611         static const DateTime& GetMaxValue(void);
612
613         /**
614          *      Gets the minimum allowable value of %DateTime (that is, "January 1 1 00:00:00.000").
615          *
616          *      @since 2.0
617          *
618          *      @return         An instance of %DateTime
619          */
620         static const DateTime& GetMinValue(void);
621
622         /**
623          *      Checks whether the year represented by the current instance of %DateTime is a leap year.
624          *
625          *      @since 2.0
626          *
627          *      @return         @c true if the year represented by the current instance of %DateTime is a leap year, @n
628          *                              else @c false
629          */
630         bool IsLeapYear(void) const;
631
632         /**
633          *      Checks whether the specified @c year is a leap year.
634          *
635          *      @since 2.0
636          *
637          *      @return         @c true if the specified year is a leap year, @n
638          *                              else @c false
639          *      @param[in]      year    The year
640          */
641         static bool IsLeapYear(int year);
642
643 private:
644         DateTime(int year, int month, int day, int hour, int minute, int second, int tick);
645
646         int CountLeapYear(int year) const
647         {
648                 return static_cast< int >((year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400);
649         }
650
651         int CountDays(int year) const
652         {
653                 return static_cast< int >((year - 1) * 365 + CountLeapYear(year));
654         }
655
656         int CountYears(int day) const
657         {
658                 double year = (day - CountLeapYear(day / 365)) / 365.0;
659                 Double year1(year);
660                 Double year2(0.0);
661
662                 if (year1.Equals(year2))
663                 {
664                         return 1;
665                 }
666                 else
667                 {
668                         year = (year != static_cast< int >(year) ? 1 + static_cast< int >(year) : static_cast< int >(year));
669                         int tempDays = day - CountDays(year);
670
671                         // Check the boundary of days
672                         if (IsLeapYear(year))
673                         {
674                                 if (tempDays > 366)
675                                 {
676                                         year += 1;
677                                 }
678                         }
679                         else
680                         {
681                                 if (tempDays > 365)
682                                 {
683                                         year += 1;
684                                 }
685                         }
686
687                         return year;
688                 }
689         }
690
691         typedef struct
692         {
693                 int year;       /**<The year (1-9999)*/
694                 int month;      /**<The month (1-12)*/
695                 int day;        /**<The day (1-31)*/
696                 int hour;       /**<The hour (0-23)*/
697                 int minute;     /**<The minute (0-59)*/
698                 int second;     /**<The first 16 bits store tick (0-999) and the last 16 bits store second (0-59)*/
699         } TmDateTime;
700
701         result ConvertTicksToDate(long long ticks, TmDateTime* pDateTime);
702         long long ConvertDateToTicks(const TmDateTime* pDateTime) const;
703
704         result ConvertSecondsToDate(long long seconds, TmDateTime* pDateTime);
705         long long ConvertDateToSeconds(const TmDateTime* pDateTime) const;
706
707         TmDateTime __dateTime;
708
709         friend class _DateTimeImpl;
710         class _DateTimeImpl* __pDateTimeImpl;
711
712 }; // DateTime
713 }}  // Tizen::Base
714 #endif // _FBASE_DATE_TIME_H_