システムの時刻と日付を設定。
#include <time.h>
int stime(time_t *t);
#include <stdio.h> #include <time.h> main() { time_t tim1; time_t tim2; struct tm *stm; int iResult = 0; /* 現在時刻の取得 */ time(&tim1) ; /* TM変換 */ stm = localtime(&tim1); /* 秒設定 */ stm->tm_sec = 0; /* TM変換 */ tim2 = mktime(stm); /* 時刻の設定 */ iResult = stime(&tim2) ; /* print */ printf ("stime : %d\n", iResult); return(0); }