日期格式转换器

时间:2014-07-30 15:29:52

标签: date format converter

int month1day1year1month2day2year2;

printf("Enter a date in the form mm-dd-yy:  ");

scanf("%d%*c%d%*c%d",  &month1, &day1, &year1)

printf(" %02d / %02d  /  %02d\n\n", month1, day1, year1);

printf("Enter a date in the form mm/dd/yy:  ");

scanf("%d%*c%d%*c%d", &month2, &day2, &year2);

printf("month = %02d  day  =  %02d   year  =  %02d\n", month2, day2, year2)

必须制作一个日期转换器,让这很简单,但努力转换为像jan feb等字符..,任何提示都会很高兴

1 个答案:

答案 0 :(得分:0)

当你使用大写字母和三个字母而不是两个字母时它会改变。

尝试:MMM