ICode9

精准搜索请尝试: 精确搜索
  • 利用C库函数time()打印当前系统动态时间2022-12-01 18:37:03

    引入日期和时间头文件#include<time.h>用time_t定义一个存储时间的变量获取时间(以秒为单位)time_t t; time (&t); //获取1970年以来的秒数,UTC(协调世界时)。struct tm 结构体根据time_t函数获得的时间通过struct tm结构体转换为本地时间(北京时间)。struct tm* mt = localtime(&t)

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有