-
stime
鎖定
stime是一種設置時間的函數。
- 中文名
- stime
- 函數名
- stime
- 功 能
- 設置時間
- 用 法
- int stime(long *tp)
函數簡介
校對時間,與date() 配合
;
程序例:
#include <stdio.h> #include <time.h> #include <dos.h> int main(void) { time_t t; struct tm *area; t = time(NULL); area = localtime(&t); printf("Number of seconds since 1/1/1970 is: %ld\n", t); printf("Local time is: %s", asctime(area)); t++; area = localtime(&t); printf("Add a second: %s", asctime(area)); t += 60; area = localtime(&t); printf("Add a minute: %s", asctime(area)); t += 3600; area = localtime(&t); printf("Add an hour: %s", asctime(area)); t += 86400L; area = localtime(&t); printf("Add a day: %s", asctime(area)); t += 2592000L; area = localtime(&t); printf("Add a month: %s", asctime(area)); t += 31536000L; area = localtime(&t); printf("Add a year: %s", asctime(area)); return 0; }
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:10次歷史版本
- 最近更新: JD萤火虫003