2010-04-18 9 views

답변

9

는 먼저 시간 객체에 시간을 추가해야하고,이 같은 그것을 다음 출력 :

boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%Y%m%d %H:%M:%S.%f"); 
std::stringstream date_stream; 
date_stream.imbue(std::locale(date_stream.getloc(), facet)); 
date_stream << boost::posix_time::microsec_clock::universal_time(); 

출력 :

20100326 12 : 02 : 08.024820

부스트로 테스트 됨 1.41

+0

밀리 초가 아닌 마이크로 초를 출력합니다. – Gabor

관련 문제