Ocular Engine
DateTime.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_TIME_DATE_TIME__H__
19 #define __H__OCULAR_TIME_DATE_TIME__H__
20 
21 #include <ctime>
22 
23 //------------------------------------------------------------------------------------------
24 
29 namespace Ocular
30 {
35  namespace Core
36  {
40  class DateTime
41  {
42  public:
43 
56  DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, bool dst = false);
57 
62  DateTime(std::tm* time, int ms = 0);
63 
64  ~DateTime();
65 
69  int getYear();
70 
74  int getMonth();
75 
79  int getDayOfMonth();
80 
84  int getDayOfYear();
85 
89  int getHour();
90 
94  int getMinute();
95 
99  int getSecond();
100 
104  int getMillisecond();
105 
109  bool getIsDST();
110 
111  protected:
112 
113  private:
114 
115  int m_Year;
116  int m_Month;
117  int m_Day;
118  int m_DayJulian;
119  int m_Hour;
120  int m_Minute;
121  int m_Second;
122  int m_Millisecond;
123 
124  bool m_DST;
125  };
126  }
130 }
135 //------------------------------------------------------------------------------------------
136 
137 #endif
int getMonth()
Definition: DateTime.cpp:113
DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, bool dst=false)
Definition: DateTime.cpp:62
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
int getDayOfYear()
Definition: DateTime.cpp:123
Definition: DateTime.hpp:40
int getYear()
Definition: DateTime.cpp:108
bool getIsDST()
Definition: DateTime.cpp:148
int getDayOfMonth()
Definition: DateTime.cpp:118
int getHour()
Definition: DateTime.cpp:128
int getMinute()
Definition: DateTime.cpp:133
int getMillisecond()
Definition: DateTime.cpp:143
int getSecond()
Definition: DateTime.cpp:138