| 322 | } |
| 323 | |
| 324 | static int days_of_year_month(int tm_year, int tm_mon) |
| 325 | { |
| 326 | int ret, year; |
| 327 | |
| 328 | year = tm_year + 1900; |
| 329 | if (tm_mon == 1) |
| 330 | { |
| 331 | ret = 28 + ((!(year % 4) && (year % 100)) || !(year % 400)); |
| 332 | } |
| 333 | else if (((tm_mon <= 6) && (tm_mon % 2 == 0)) || ((tm_mon > 6) && (tm_mon % 2 == 1))) |
| 334 | { |
| 335 | ret = 31; |
| 336 | } |
| 337 | else |
| 338 | { |
| 339 | ret = 30; |
| 340 | } |
| 341 | |
| 342 | return (ret); |
| 343 | } |
| 344 | |
| 345 | static rt_bool_t is_valid_date(struct tm *date) |
| 346 | { |