当前位置: 技术问答>linux和unix
一个匪夷所思的问题,请高手赐教,急!!!!!!!!!!!!!!
来源: 互联网 发布时间:2015-12-29
本文导语: #include #include using namespace std; int main() { struct tm *tt,*middle_tm,temp_tm; time_t yy; time(&yy); tt = localtime(&yy); middle_tm = localtime(&yy); temp_tm.tm_sec = mi...
#include
#include
using namespace std;
int main()
{
struct tm *tt,*middle_tm,temp_tm;
time_t yy;
time(&yy);
tt = localtime(&yy);
middle_tm = localtime(&yy);
temp_tm.tm_sec = middle_tm->tm_sec;
temp_tm.tm_min = middle_tm->tm_min;
temp_tm.tm_hour = middle_tm->tm_hour;
temp_tm.tm_mday = middle_tm->tm_mday;
temp_tm.tm_mon = middle_tm->tm_mon;
temp_tm.tm_year = middle_tm->tm_year;
temp_tm.tm_wday = middle_tm->tm_wday;
temp_tm.tm_yday = middle_tm->tm_yday;
temp_tm.tm_isdst = middle_tm->tm_isdst;
//printf("%dn",tt->tm_yday);
//printf("%dn",tt->tm_mday);
struct tm start_tm;
//指定日期
start_tm.tm_year = 2006-1900;
start_tm.tm_mon = 0;
start_tm.tm_mday =1;
char str[4];
time_t time_11 = mktime(&start_tm);
////////////////////////////////////
/***************注意下面这个输出语句:*********************/
cout
#include
using namespace std;
int main()
{
struct tm *tt,*middle_tm,temp_tm;
time_t yy;
time(&yy);
tt = localtime(&yy);
middle_tm = localtime(&yy);
temp_tm.tm_sec = middle_tm->tm_sec;
temp_tm.tm_min = middle_tm->tm_min;
temp_tm.tm_hour = middle_tm->tm_hour;
temp_tm.tm_mday = middle_tm->tm_mday;
temp_tm.tm_mon = middle_tm->tm_mon;
temp_tm.tm_year = middle_tm->tm_year;
temp_tm.tm_wday = middle_tm->tm_wday;
temp_tm.tm_yday = middle_tm->tm_yday;
temp_tm.tm_isdst = middle_tm->tm_isdst;
//printf("%dn",tt->tm_yday);
//printf("%dn",tt->tm_mday);
struct tm start_tm;
//指定日期
start_tm.tm_year = 2006-1900;
start_tm.tm_mon = 0;
start_tm.tm_mday =1;
char str[4];
time_t time_11 = mktime(&start_tm);
////////////////////////////////////
/***************注意下面这个输出语句:*********************/
cout