1.核心理论
* Coordinated Universal Time (UTC):世界标准时间,也就是格林威治时间 (Greenwich Mean Time,GMT)
* Calendar Time:日历时间,从1970年1月1日0点到此时经历的秒数来表示时间
2.函数学习
获取日历时间
函数名:time
函数原型:time_t time(time_t *t);
头文件:<time.h>
函数功能:返回日历时间
返回值: 成功:返回日历时间 失败:-1
参数说明:t:不为空保存返回值
获取格林威治时间
函数名:gmtime
函数原型:struct tm *gmtime(const time_t *timep);
头文件:<time.h>
功能:将日历时间转化为标准时间
返回值:成功:以struct tm形式存储的标准时间
参数说明:待转化的日历时间
获取本地时间
函数名:localti