/* This function is used to calculate month and day of month according to year and day of the year.  */
static void rtc_calculate_mday(int year, int yday, int *mon, int *mday)
/* This function is used to calculate month and day of month according to year and day of the year.  */
static void rtc_calculate_mday(int year, int yday, int *mon, int *mday)
{
	int t_mon = -1, t_yday = yday + 1;
	while(t_yday > 0){
		t_mon ++;
		t_yday -= days_in_month(t_mon, year);
	}
	*mon = t_mon;
	*mday = t_yday + days_in_month(t_mon, year);
}