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