#include #include int main(void) { time_t now = time(0); char buf[1024]; struct tm *t = localtime(&now); int gmtoff = t->tm_gmtoff / 60; printf("tm_gmtoff = %+03d%02d, tm_zone = %s\n", gmtoff / 60, gmtoff % 60, t->tm_zone); strftime(buf, sizeof(buf), "tm_gmtoff = %z, tm_zone = %Z\n", t); fputs(buf, stdout); return 0; }