歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

Linux時間設置開發板時間設置

系統查看時間用 date
更改時間用     date  ‘22:39:30 2012-06-12' (root) 即將時間改為2012年6月12日 22點39分30秒
程序實現date命令
#include <stdio.h>
#include <time.h>
 
int main()
{
    time_t tim;
    time(&tim);
    printf("%s",ctime(&tim));
    return 0;
}
 
開發板上設置系統時間
date 061223052012.30     月日時分年.秒
查看硬件時間     hwclock --show
硬件時間同步     hwclock --systohc
重啟後時間錯亂.
Copyright © Linux教程網 All Rights Reserved