1 | <?php |
||
10 | class DateTime |
||
11 | { |
||
12 | use Operations\Initiator, |
||
13 | Operations\Processor, |
||
14 | Operations\Formatter; |
||
15 | |||
16 | /** |
||
17 | * The Gregorian Date. |
||
18 | * |
||
19 | * @var GregorianDateTime |
||
20 | */ |
||
21 | protected $dateTime; |
||
22 | |||
23 | /** @var int */ |
||
24 | protected $year; |
||
25 | |||
26 | /** @var int */ |
||
27 | protected $month; |
||
28 | |||
29 | /** @var int */ |
||
30 | protected $day; |
||
31 | |||
32 | /** @var bool */ |
||
33 | protected $leapYear; |
||
34 | |||
35 | /** @var int */ |
||
36 | protected $dayOfYear; |
||
37 | |||
38 | /** @var int */ |
||
39 | protected $daysInMonth; |
||
40 | |||
41 | /** |
||
42 | * Returns the Ethiopian Year. |
||
43 | * |
||
44 | * @return int year |
||
45 | */ |
||
46 | 46 | public function getYear() |
|
50 | |||
51 | /** |
||
52 | * Returns the Ethiopian Month. |
||
53 | * |
||
54 | * @return int month |
||
55 | */ |
||
56 | 45 | public function getMonth() |
|
60 | |||
61 | /** |
||
62 | * Returns the Ethiopian Day. |
||
63 | * |
||
64 | * @return int day |
||
65 | */ |
||
66 | 45 | public function getDay() |
|
70 | |||
71 | /** |
||
72 | * Returns true if the Year is a leap. |
||
73 | * |
||
74 | * @return bool leap year |
||
75 | */ |
||
76 | 2 | public function isLeapYear() |
|
80 | |||
81 | /** |
||
82 | * Returns the day Of the Year. |
||
83 | * |
||
84 | * Day of the year is the number of days(inclusive) |
||
85 | * have passed since the new year |
||
86 | * |
||
87 | * Eg. 'ኅዳር 29' day of the year is 89 |
||
88 | * |
||
89 | * @return int day Of the Year |
||
90 | */ |
||
91 | 2 | public function getDayOfYear() |
|
95 | |||
96 | /** |
||
97 | * Returns number of days in the given year. |
||
98 | * |
||
99 | * It's 30 except 'ጳጉሜን' |
||
100 | * |
||
101 | * @return int days in the month |
||
102 | */ |
||
103 | 2 | public function getDaysInMonth() |
|
107 | |||
108 | /** |
||
109 | * Returns the Hour. |
||
110 | * |
||
111 | * @return int hour |
||
112 | */ |
||
113 | 5 | public function getHour() |
|
117 | |||
118 | /** |
||
119 | * Returns the Minute. |
||
120 | * |
||
121 | * @return int minute |
||
122 | */ |
||
123 | 1 | public function getMinute() |
|
127 | |||
128 | /** |
||
129 | * Returns the Second. |
||
130 | * |
||
131 | * @return int second |
||
132 | */ |
||
133 | 1 | public function getSecond() |
|
137 | |||
138 | /** |
||
139 | * Returns the Micro. |
||
140 | * |
||
141 | * @return int micro |
||
142 | */ |
||
143 | 1 | public function getMicro() |
|
147 | |||
148 | /** |
||
149 | * Returns the Day of the week. |
||
150 | * |
||
151 | * 1 (for ሰኞ) through 7 (for እሑድ) |
||
152 | * |
||
153 | * @return int day of the week |
||
154 | */ |
||
155 | 4 | public function getDayOfWeek() |
|
159 | |||
160 | /** |
||
161 | * Returns the Timestamp. |
||
162 | * |
||
163 | * @see time() |
||
164 | * |
||
165 | * @return int timestamp |
||
166 | */ |
||
167 | 1 | public function getTimestamp() |
|
171 | |||
172 | /** |
||
173 | * DateTime constructor. |
||
174 | * |
||
175 | * @param GregorianDateTime|null $dateTime |
||
176 | */ |
||
177 | 49 | public function __construct(GregorianDateTime $dateTime = null) |
|
187 | |||
188 | /** |
||
189 | * Return the <b>clone</b> of the base gregorian datetime. |
||
190 | * |
||
191 | * @return GregorianDateTime |
||
192 | */ |
||
193 | 49 | public function toGregorian() |
|
197 | } |
||
198 |