There is no technical content, but it is nothing to do. I just remember this. In Windows, it seems that this API function is available, but it cannot be used in windows, so I have to encapsulate it myself. The general code is as follows:
/*the seconds of round year = 3600*24*366 */#define SECONDOFROUNDYEAR 31622400/*the seconds of general year = 3600*24*365 */#define SECONDOFYEAR 31536000unsigned int SecondsFrom1970(){SYSTEMTIME st;unsigned int tTemp=0;unsigned int tSecond=0;int month_s[2][12]={{31,28,31,30,31,30,31,31,30,31,30,31},{31,29,31,30,31,30,31,31,30,31,30,31}};int nDays=0;int nCount=0;int i;int j;GetLocalTime(&st);tSecond=st.wHour*3600+st.wMinute*60+st.wSecond;for (i=1970;i<st.wYear;++i){if (IsRound(i))++nCount;}tTemp+=(st.wYear-1970-nCount)*SECONDOFYEAR+nCount*SECONDOFROUNDYEAR;if (st.wMonth>1){if (IsRound(st.wYear)){for (j=0;j<st.wMonth-1;++j){tTemp+=month_s[1][j]*MAXSECONDOFDAY;}tTemp+=(st.wDay-1)*MAXSECONDOFDAY+tSecond;}else{for (j=0;j<st.wMonth-1;++j){tTemp+=month_s[0][j]*MAXSECONDOFDAY;}tTemp+=(st.wDay-1)*MAXSECONDOFDAY+tSecond;}}else{tTemp+=(st.wDay-1)*MAXSECONDOFDAY+tSecond;}return tTemp;}bool IsRound(int year){/*is round year?*/if((year%100)&&(year%4==0)) return 1;if((year%100==0)&&(year%400==0)) return 1;return 0;}