/* get the local system date */
int get_system_date(char *str_date)
{
struct tm *tp=NULL;
time_t t;
time(&t);
tp = (struct tm *)localtime(&t);
sprintf(str_date, "%04d%02d%02d", tp->tm_year+1900,tp->tm_mon+1,tp->tm_mday);
return 0;
}
/*附另一参考函数*/
int GetSysDateTime(char *DateStr)
{
struct tm *tp=NULL;
time_t t;
time(&t);
tp = (struct tm *)localtime(&t);
sprintf(DateStr,"%04d%02d%02d%02d%02d%02d",
tp->tm_year+1900,tp->tm_mon+1,tp->tm_mday,tp->tm_hour,tp->tm_min,tp->tm_sec);
return(0);
}