ftime.c

来自「经典编程900例(C语言),学习编程基础的好资料。」· C语言 代码 · 共 24 行

C
24
字号
#include <stdio.h>
#include <time.h>
#include <sys\timeb.h>

void main(void)
 {
   struct timeb timezone;

   tzset();

   ftime(&timezone);

   printf("Seconds since 1 January 1970 (GMT) %ld\n",
     timezone.time);
   printf("Fractional seconds %d\n", timezone.millitm);
   printf("Hours difference between GMT and local zone %d\n",
     timezone.timezone / 60);
   if (timezone.dstflag)
     printf("Daylight savings time active\n");
   else
     printf("Daylight savings time inactive\n");
 }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?