[C] 日期 时间转换为UNIX时间 →→→→→进入此内容的聊天室

来自 , 2021-01-26, 写在 C, 查看 127 次.
URL http://www.code666.cn/view/06d5ae10
  1. #include <time.h>
  2. #include <stddef.h>
  3. #include <dos.h>
  4. #include <stdio.h>
  5.  
  6. int main ( void )
  7. {
  8.         time_t t;
  9.         struct time d_time;
  10.         struct date d_date;
  11.         struct tm *local;
  12.  
  13.         getdate ( &d_date );
  14.         gettime ( &d_time );
  15.  
  16.         t = dostounix ( &d_date, &d_time );
  17.         local = localtime ( &t );
  18.         printf ( "Time and Date: %s\n", \
  19.                  asctime ( local ) );
  20.  
  21.         return 0;
  22. }
  23.  

回复 "日期 时间转换为UNIX时间"

这儿你可以回复上面这条便签

captcha