코딩Coding/C++_연습
-
C++연습_날짜와 시간을 문자열로 변환하기(localtime)코딩Coding/C++_연습 2020. 9. 18. 00:02
VSCode Cmake로 실행함. #include #include #include const std::string currentDataTime() { time_t now = time(0); struct tm tstruct; char buf[80]; tstruct = *localtime(&now); strftime(buf, sizeof(buf), "%Y-%m-%d.%X", &tstruct); return buf; } int main() { std::cout