#include #include #include void check_year (int year) { struct tm tm; tm.tm_year = year - 1900; tm.tm_mon = 7; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = 1; time_t t = mktime (&tm); if (t != (time_t) -1) { char buf[1000]; strftime (buf, sizeof buf, "%Y-%m-%d %H:%M:%S %z %Z", &tm); puts (buf); } } int main (void) { setenv ("TZ", "Pacific/Apia", 1); check_year (2029); check_year (2030); }