기본 콘텐츠로 건너뛰기

1월, 2020의 게시물 표시

c++ 현재 시간의 ms 구하는 함수

link:  https://stackoverflow.com/questions/19555121/how-to-get-current-timestamp-in-milliseconds-since-1970-just-the-way-java-gets 현재 시간의 milisecond 단위 구하는 함수, C++ __int64 llTime = 0; std::chrono::milliseconds ms = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch()); llTime = static_cast<long long>(ms.count());

윈도우 환경변수에 오늘 날짜 구하기

Windows /cmd /batch shell/ save to variable @REM 날짜 프로그램으로 오늘 날짜 추출하여 환경변수에 저장 FOR /F "TOKENS=1 eol=/ DELIMS=/ " %%A IN ('DATE /T') DO SET Y4_M2_D2=%%A SET Y2M2D2=%Y4_M2_D2:~2,2%%Y4_M2_D2:~5,2%%Y4_M2_D2:~8,2% SET TODAY=%Y2M2D2% @REM 또는 다른 형태로 값을 얻어와서 합치기 @REM for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x @REM set Y4M2D2_VAR=%Year%%Month%%Day% @REM set Y2M2D2_VAR=%Year:~2,2%%Month%%Day%