480
480
return week_number;
484
* Takes a number in the form [YY]YYMM and converts it into
485
* a number of months.
487
* @param Period in the form [YY]YYMM
489
uint32_t year_month_to_months(uint32_t year_month)
494
uint32_t years= year_month / 100;
495
if (years < CALENDAR_YY_PART_YEAR)
497
else if (years < 100)
500
uint32_t months= year_month % 100;
501
return (years * 12) + (months - 1);
505
* Takes a number of months and converts it to
506
* a period in the form YYYYMM.
508
* @param Number of months
510
uint32_t months_to_year_month(uint32_t months)
515
uint32_t years= (months / 12);
518
years+= (years < CALENDAR_YY_PART_YEAR) ? 2000 : 1900;
520
return (years * 100) + (months % 12) + 1;