root@wisdom-B250-HD3:/tmp# cat 151623.c
/*************************************************************************
> File Name: 151623.c
> Author:
> Mail:
> Created Time: 2019年09月18日 星期三 15时16分28秒
************************************************************************/
#include <stdio.h>
#include <time.h>
int main(void)
{
struct tm *tblock;
time_t t_now = time(NULL);
time_t t_max = 0x7fffffff;
time_t t_tmp = t_max - t_now;
printf("the difference is %f seconds\n", difftime(t_max, t_now));
tblock = localtime(&t_tmp);
printf("%s\n", asctime(tblock));
return 0;
}
root@wisdom-B250-HD3:/tmp# ./a.out
the difference is 578690918.000000 seconds
Wed May 4 04:28:38 1988
root@wisdom-B250-HD3:/tmp#
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交