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