1. 소스 내용
#include <iostream> #include <cstdlib> #include <time.h> using namespace std; int main() { struct tm* datetime; time_t t; t = time(NULL); datetime = localtime(&t); printf("%d/%02d/%02d %02d:%02d:%02d", datetime->tm_year + 1900, datetime->tm_mon + 1, datetime->tm_mday, datetime->tm_hour, datetime->tm_min, datetime->tm_sec ); return 0; }
2. 실행결과
2012/10/09 14:38:28
댓글 없음 :
댓글 쓰기