自动更新程序发布日期的方法

void ConvertDate(void)
{
 char APP_DATE[]=__DATE__;
 char APP_MONTH[4];
 int APP_YEAR;
 int APP_DAILY_VERSION;
 sscanf(APP_DATE,"%s %d %d",APP_MONTH,&APP_DAILY_VERSION,&APP_YEAR);
 g_APP_YEAR_VERSION=APP_YEAR-(APP_YEAR/100)*100;
 if (strcmp(APP_MONTH,"Jan")==0)
  g_APP_MONTH_VERSION=1;
 else if (strcmp(APP_MONTH,"Feb")==0)
  g_APP_MONTH_VERSION=2;
 else if (strcmp(APP_MONTH,"Mar")==0)
  g_APP_MONTH_VERSION=3;
 else if (strcmp(APP_MONTH,"Apr")==0)
  g_APP_MONTH_VERSION=4;
 else if (strcmp(APP_MONTH,"May")==0)
  g_APP_MONTH_VERSION=5;
 else if (strcmp(APP_MONTH,"Jun")==0)
  g_APP_MONTH_VERSION=6;
 else if (strcmp(APP_MONTH,"Jul")==0)
  g_APP_MONTH_VERSION=7;
 else if (strcmp(APP_MONTH,"Aug")==0)
  g_APP_MONTH_VERSION=8;
 else if (strcmp(APP_MONTH,"Sep")==0)
  g_APP_MONTH_VERSION=9;
 else if (strcmp(APP_MONTH,"Oct")==0)
  g_APP_MONTH_VERSION=10;
 else if (strcmp(APP_MONTH,"Nov")==0)
  g_APP_MONTH_VERSION=11;
 else if (strcmp(APP_MONTH,"Dec")==0)
  g_APP_MONTH_VERSION=12;
 else
  g_APP_MONTH_VERSION=0;
 g_APP_DAILY_VERSION=APP_DAILY_VERSION;
 if (g_lost_and_freeze)
 {
  g_Set[23]=0xa;
  g_Set[24]=0x00;
 }
}

你可能感兴趣的:(Date)