获取当前时间
- static void get_local_time(char *pc_str)
- {
- time_t now;
- struct tm *timenow;
- assert(pc_str != NULL);
- /*
- time_t t;
- srand((unsigned)time(&t)); //初始化随机种子, 否则随机数不随机
- */
- time(&now);
- timenow = localtime(&now);
- sprintf(pc_str, "%04d-%02d-%02dT%02d:%02d:%02d", timenow->tm_year+1900, timenow->tm_mon+1, timenow->tm_mday,
- timenow->tm_hour, timenow->tm_min, timenow->tm_sec);
- }

浙公网安备 33010602011771号