如下的代码内容是关于C语言基础:timezone名字显示的代码。
#include <stdio.h>
#include <time.h>
int main(void)
{
tzset();
printf(“Current time zone is %sn”, tzname[0]);
if (tzname[1])
printf(“Daylight savings zone is %sn”, tzname[1]);
else
printf(“Daylight savings zone is not definedn”);
return 1;
}
显示结果
Current time zone is CST
Daylight savings zone is CDT