Chinaunix首页 | 论坛 | 博客
  • 博客访问: 929390
  • 博文数量: 210
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2070
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-19 21:54
文章分类

全部博文(210)

文章存档

2020年(2)

2019年(18)

2018年(27)

2017年(5)

2016年(53)

2015年(88)

2014年(17)

分类: 嵌入式

2015-05-09 23:32:02

UTC标准时间

CT日历时间,从一个标准时间点(如1970.1.1     0点)到现在所经历的秒数

日历时间获取  time_t  time(time_t  *tloc)    

日历时间转化为标准时间  strut  tm  *gmtime(time_t  *timep)

日历时间转化为本地时间  strut  tm  *localtime(time_t  *timep)

tm 结构体

      struct   tm {

                  int  tm_sec;                秒值

                  int  tm_min;                分值

                  int  tm_hour;              小时       

                  int  tm_mday;            本月第几日

                  int  tm_mon ;             本年第几月

                  int  tm_year;              tm_year+1900=今年

                  int  tm_wday;             本周第几日

                  int  tm_yday;              本年第几日

                  int  tm_isdst;              日光节约时间

                   }

将tm格式的时间转化为字符串格式   char *asctime(const  struct  tm  *tm)

将日历时间转化为字符窜格式    char  *ctime  (const  time_t  timep)

获取今日凌晨到现在的时间差  int  gettimeofday(struct timeval  *tv,struct timezone  *tz)

        struct  timeval  {

                   int  tv_sec;     秒数

                   int  tv_usec       微秒

                            }

延时执行 unsigned int sleep (unsigned int sec)      使程序睡眠n秒

                void  usleep(unsigned  long  usec)          使程序睡眠微秒

阅读(730) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~