#include #include #include #include using namespace std; void print_time (ostream& os, const time_t& t) { struct tm* time = localtime (&t); os << t << "="; if (!time) os << "(null)"; else { char buf[20]; strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S", time); os << buf; } os << "\n"; } int main () { print_time (cout, 0); print_time (cout, time (0)); print_time (cout, -1); print_time (cout, numeric_limits::min ()); print_time (cout, numeric_limits::max ()); print_time (cout, numeric_limits::min ()); print_time (cout, numeric_limits::max ()); return EXIT_SUCCESS; }