stime

提供: RAD Studio
移動先: 案内検索

time.h:インデックス への移動


ヘッダーファイル

time.h

カテゴリ

日付/時刻ルーチン

プロトタイプ

int stime(time_t *tp);

説明

システムの日付と時刻を設定します。

stime は,システムの時刻と日付を設定します。tp は,1970 年 1 月 1 日 00 時 00 分 00 秒から計測された時間値(秒単位)へのポインタです。

戻り値

stime は,値 0 を返します。



 #include <stdio.h>
 #include <time.h>
 int main(void)
 {
   time_t t;
   t = time(NULL);
   printf("Current date is %s", ctime(&t));
   t -= 24L*60L*60L;  /* 前日の同じ時刻に戻ります */
   stime(&t);
   printf("\nNew date is %s", ctime(&t));
    return 0;
 }



移植性



POSIX Win32 ANSI C ANSI C++

+