首先,时间戳都应该采用这种格式 yyyy / mmm / hh / mm / ss并且当它们不在此时会弹出错误 格式。
我也想找到它们之间的区别。例如。如果time1 = 2000/034/08/12/00
time2 = 2000/034/07/12/00
TIME = time1 - time2
时间= 60分钟
if (sscanf(now,"%d/%d/%d/%d/%d",&year,&month,&hour,&min,&sec) != 5) //Error - If enter more than 5 numbers still give correct answer //CHECKING IF THE ARGUMENT IS CORRECT OR NOT
{
fprintf(stderr,"\x1b[1;31mMust specify correct timestamp format\nExiting........\x1b[0m\n");
exit(1);
}