【初心者歓迎】C/C++室 Ver.22【環境依存OK】
■ このスレッドは過去ログ倉庫に格納されています
0069デフォルトの名無しさん
2005/10/10(月) 18:29:23結果は
98年1月31日 23時59分59秒 ==> 888937199
98年2月1日 0時0分0秒 ==> 888678000
となってしまいます。
使い方が間違ってますか?
#include<iostream>
#include<time.h>
using namespace std;
main(){
time_t seconds;
struct tm timeptr;
timeptr.tm_mday = 31;
timeptr.tm_mon = 1;
timeptr.tm_year = 98;
timeptr.tm_hour =23;
timeptr.tm_min = 59;
timeptr.tm_sec = 59;
seconds = mktime(&timeptr);
cout<<seconds<<endl;
timeptr.tm_mday = 1;
timeptr.tm_mon = 2;
timeptr.tm_year = 98;
timeptr.tm_hour =0;
timeptr.tm_min = 0;
timeptr.tm_sec = 0;
seconds = mktime(&timeptr);
cout<<seconds<<endl;
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています