You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1bb/room_xitongshijian.cpp

24 lines
676 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include<room1.cpp>
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;
}