全部博文(168)
分类: LINUX
2011-04-14 21:28:01
#include
#include
#include
struct timex txc;
struct rtc_time tm;
do_gettimeofday(&(txc.time));
rtc_time_to_tm(txc.time.tv_sec,&tm);
printk(“UTC time :%d-%d-%d %d:%d:%d \n”,tm.tm_year+1900,tm.tm_mon, tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
//注意:这样获取的是utc时间
-------------------------------------------------------------------------------------------
get os start time (用户态获取系统启动时间的方法):