char month[6];
char day[3];

int GetMonth(char *token) {
	//char month[3];
	//2009-03-11
	char buf[3];
	memset ((void*) buf, '\0', sizeof (buf));
	buf[0] = token[5];
	buf[1] = token[6];
		

	//month[2] = '/0';
	day[0] = token[8];
	day[1] = token[9];
	//printf("buf: %s\n", buf);

	if(strcmp(buf, "01") == 0) {
		strcpy(month, "Jan");
	}else if(strcmp(buf, "02") == 0) {
		strcpy(month, "Feb");
        }else if(strcmp(buf, "03") == 0) {
                strcpy(month, "Mar");
        }else if(strcmp(buf, "04") == 0) {
                strcpy(month, "Apr");
        }else if(strcmp(buf, "05") == 0) {
                strcpy(month, "May");
        }else if(strcmp(buf, "06") == 0) {
                strcpy(month, "Jun");
        }else if(strcmp(buf, "07") == 0) {
                strcpy(month, "Jul");
        }else if(strcmp(buf, "08") == 0) {
                strcpy(month, "Aug");
        }else if(strcmp(buf, "09") == 0) {
                strcpy(month, "Sep");
        }else if(strcmp(buf, "10") == 0) {
                strcpy(month, "Oct");
        }else if(strcmp(buf, "11") == 0) {
                strcpy(month, "Nov");
        }else if(strcmp(buf, "12") == 0) {
                strcpy(month, "Dec");
	}

	//printf("month: %s\n", month);

	return;
}



int DateCalc(char *token) {
	//int index;
	//2009-03-12:
	//char buf[2];
	//char year[4];
	char month[2];
	char day[2];
	int i = 0;

/*
	while(i < strlen(token)) {
		if(token[i] != '-' && token[i] != ':') {
			if(i < 4) {
				strcat(year, 
			}else if(i < 7) {

			}else{

			}

		}
	}
*/
	/*
	for(int i=0; i<4; i++) {
		year[i] = token[i];
	}
	year[4] = '/0';
	*/

	month[0] = token[5];
	month[1] = token[6];
	//month[2] = '/0';
	day[0] = token[8];
	day[1] = token[9];
	//day[2] = '/0';

	i = atoi(day);
	i += (atoi(month)-1) * 31;
	//i += atoi(year);
	//printf("day:%s\n", day);
	return i;
}
