1. 首页
  2. 数据库
  3. 其它
  4. C++获取本地时间常见方法汇总

C++获取本地时间常见方法汇总

上传者: 2021-01-16 23:28:55上传 PDF文件 59.12KB 热度 8次
1.跨平台方法 1.1方法一:手动暴力法 #include using namespace std; #include time_t t = time(NULL); struct tm* stime=localtime(&t); char tmp[32]={NULL}; sprintf(tmp, "d-d-d d:d:d",1900+stime->tm_year,1+stime->tm_mon,stime->tm_mday, stime->tm_hour,stime->tm_min,stime->tm_sec); c
下载地址
用户评论