diff --git a/room_xitongshijian.cpp b/room_xitongshijian.cpp new file mode 100644 index 0000000..cd764ec --- /dev/null +++ b/room_xitongshijian.cpp @@ -0,0 +1,23 @@ +#include +int xitongshijian(int *i,int *o,int *l) +{ + time_t timep,Tim; + struct tm *p; + time(&timep); + p = localtime(&timep); //此函数获得的tm结构体的时间,是已经进行过时区转化为本地时间 + //p = gmtime(&timep); //把日期和时间转换为格林威治(GMT)时间的函数 + int Year = 1900 + p->tm_year; + int Month = 1 + p->tm_mon; + int Day = p->tm_mday; + int Hour = p->tm_hour; + int Minute = p->tm_min; + int Second = p->tm_sec; + char year[20]; + char month[20]; + char day[20]; + char hour[20]; + char minute[20]; + char second[20]; + *i=Month;*o=Day;*l=Hour; + return 0; +} diff --git a/room_xitongshijian.exe b/room_xitongshijian.exe new file mode 100644 index 0000000..4da285c Binary files /dev/null and b/room_xitongshijian.exe differ