关于时间操作的标注库
localtime() 使用 timer 的值来填充 tm 结构
#define _CRT_SECURE_NO_WARNINGS
#include <time.h>
#include <iostream>
int main()
{
time_t ti;
time(&ti); //获取当前时间
tm* time = localtime(&ti); //填充tm结构体
std::cout << time->tm_year+1900 << std::endl; //年
std::cout << time->tm_mon+1 << std::endl; //月
std::cout << time->tm_mday << std::endl; //日
std::cout << time->tm_hour << std::endl; //小时
std::cout << time->tm_min<< std::endl; //分钟
std::cout << time->tm_sec << std::endl; //秒
std::system("pause");
return 0;
}