#include #include #include #include #include "datetime.h" int main(int argc, char *argv[]) { struct tm tm; time_t tt; char buf[64]; tm.tm_year = 2011 - 1900; tm.tm_mon = 12 - 1; tm.tm_mday = 9; tm.tm_hour = 15; tm.tm_min = 15; tm.tm_sec = 52; putenv("TZ=GMT+0"); tt = mktime(&tm); memset(&tm, 0, sizeof(tm)); tm = *gmtime(&tt); strftime(buf, sizeof(buf), "%Y.%m.%d %H.%M.%S", &tm); puts(buf); return 0; }