#include <sys/time.h> #include <unistd.h>
int settimeofday(const struct timeval *tv, const struct timezone *tz);
#include <sys/time.h> #include <unistd.h>
struct timeval{
long tv_sec; //秒
long tv_usec; //微秒
};
struct timezone
{
int tz_minuteswest; //和Greenwich 时间差了多少分钟
int tz_dsttime; //日光节约时间的状态
};
DST_NONE //不使用 DST_USA //美国 DST_AUST //澳洲 DST_WET //西欧 DST_MET //中欧 DST_EET //东欧 DST_CAN //加拿大 DST_GB //大不列颠 DST_RUM //罗马尼亚 DST_TUR //土耳其 DST_AUSTALT //澳洲(1986 年以后)
#include <sys/time.h>
#include <unistd.h>
main(){
struct timeval tv;
struct timezone tz;
gettimeofday (&tv, &tz);
printf("tv_sec; %d\n", tv.tv_sec);
printf("tv_usec; %d\n", tv.tv_usec);
printf("tz_minuteswest; %d\n", tz.tz_minuteswest);
printf("tz_dsttime, %d\n", tz.tz_dsttime);
}
tv_sec: 974857339 tv_usec:136996 tz_minuteswest:-540 tz_dsttime:0
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有