因学校项目需要这么一个数据,百度整理之,遂造出一个小轮子,大家自取
#include<ctime>
#include<iostream>
int main()
{
using namespace std;
struct tm t2006 {0};
t2006.tm_year = 2006 - 1900;
t2006.tm_mon = 1;
t2006.tm_mday = 1;
time_t nowtime;
time(&nowtime);
//当前时间和2006年1月1日之间相差的秒数
double diff = difftime(nowtime, mktime(&t2006));
return 0;
}