| @@ 233-239 (lines=7) @@ | ||
| 230 | * |
|
| 231 | * @return int days in month |
|
| 232 | */ |
|
| 233 | public function getDaysInMonth($y, $m) |
|
| 234 | { |
|
| 235 | $stamp = self::dateToStamp($y, $m, 1); |
|
| 236 | $date = self::stampCollection($stamp); |
|
| 237 | ||
| 238 | return $date[6]; |
|
| 239 | } |
|
| 240 | ||
| 241 | /** |
|
| 242 | * Returns numeric representation of the day of the week in a month, |
|
| @@ 250-256 (lines=7) @@ | ||
| 247 | * |
|
| 248 | * @return int from 0 to 6 |
|
| 249 | */ |
|
| 250 | public function getFirstDayInMonth($y, $m) |
|
| 251 | { |
|
| 252 | $stamp = self::dateToStamp($y, $m, 1); |
|
| 253 | $date = self::stampCollection($stamp); |
|
| 254 | ||
| 255 | return $date[8]; |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * Returns the number of days in a week. |
|
| @@ 281-287 (lines=7) @@ | ||
| 278 | * |
|
| 279 | * @return int week number |
|
| 280 | */ |
|
| 281 | public function getWeekNInYear($y, $m, $d) |
|
| 282 | { |
|
| 283 | $stamp = self::dateToStamp($y, $m, $d); |
|
| 284 | $date = self::stampCollection($stamp); |
|
| 285 | ||
| 286 | return $date[7]; |
|
| 287 | } |
|
| 288 | ||
| 289 | /** |
|
| 290 | * Returns the number of the week in the month, given a date. |
|
| @@ 351-357 (lines=7) @@ | ||
| 348 | * |
|
| 349 | * @return int weekday number |
|
| 350 | */ |
|
| 351 | public function getDayOfWeek($y, $m, $d) |
|
| 352 | { |
|
| 353 | $stamp = self::dateToStamp($y, $m, $d); |
|
| 354 | $date = self::stampCollection($stamp); |
|
| 355 | ||
| 356 | return $date[8]; |
|
| 357 | } |
|
| 358 | ||
| 359 | /** |
|
| 360 | * Returns a list of integer days of the week beginning 0. |
|