linux中时间的获取
来源:互联网 发布:rmvb视频剪辑软件 编辑:程序博客网 时间:2024/05/18 00:51
time_t是一个在time.h中定义好的结构体。原形如下:
struct tm
{
int tm_sec;//seconds 0-61
int tm_min;//minutes 1-59
int tm_hour;//hours 0-23
int tm_mday;//day of the month 1-31
int tm_mon;//months since jan 0-11
int tm_year;//years from 1900
int tm_wday;//days since Sunday, 0-6
int tm_yday;//days since Jan 1, 0-365
int tm_isdst;//Daylight Saving time indicator
};
void mygettime(){time_t t; struct tm *tm_t; time(&t); tm_t=localtime(&t); printf("the current time is:%02d:%02d:%02d\n",tm_t->tm_hour,tm_t->tm_min,tm_t->tm_sec); printf("the current day is:%4d:%02d:%02d\n",printf("the current day is:%d:%2d:%2d\n", tm_t->tm_year+1900,tm_t->tm_mon+1,tm_t->tm_mday); //这边得自己手动加个1990,和加个 1,因为。。。见定义。。。}
- linux中时间的获取
- linux中时间精度的获取问题
- Linux中 本地时间获取
- 在linux系统中使用date获取时间的坑
- 如何获取Linux的时间?
- linux获取时间的方法
- Linux 获取时间的方法
- JSP中时间的获取
- Linux内核中获取当前时间
- linux在shell中获取时间
- linux在shell中获取时间
- linux在shell中获取时间
- linux在shell中获取时间
- linux在shell中获取时间
- [转]linux在shell中获取时间
- linux在shell中获取时间
- linux在shell中获取时间
- Linux内核中获取时间函数do_gettimeofday
- blocks
- PostgreSQL 简介
- CentOS6.2下一步一步源代码安装OpenStack(五)nova配置、运行、测试
- 屏幕截图程序(WTL)
- 绑定变量及其优缺点
- linux中时间的获取
- 快速排序的简单实现
- Learning OpenCV亚像素级角点检测方法——运动与跟踪基础
- 配置错误页
- Google App Engine (Java + String + Velocity)数据访问调试,出现错误 Cannot find class [javax.naming.Context]
- CentOS6.2下一步一步源代码安装OpenStack(六)horizon配置、运行、测试
- Android bootloader
- OpenStack相关软件下载及说明
- CentOS6.2下一步一步源代码安装OpenStack(七)安装配置计算节点