comparison Core/Toolbox.cpp @ 1555:d6a93e12b1c1

Creation of DICOM files with encapsulated PDF
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Aug 2015 15:18:13 +0200
parents a13581480b1f
children ad1e127b4ed5
comparison
equal deleted inserted replaced
1554:89ab71a68fcf 1555:d6a93e12b1c1
774 std::string Toolbox::GetNowIsoString() 774 std::string Toolbox::GetNowIsoString()
775 { 775 {
776 boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); 776 boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
777 return boost::posix_time::to_iso_string(now); 777 return boost::posix_time::to_iso_string(now);
778 } 778 }
779
780 void Toolbox::GetNowDicom(std::string& date,
781 std::string& time)
782 {
783 boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
784 tm tm = boost::posix_time::to_tm(now);
785
786 char s[32];
787 sprintf(s, "%04d%02d%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
788 date.assign(s);
789
790 // TODO milliseconds
791 sprintf(s, "%02d%02d%02d.%06d", tm.tm_hour, tm.tm_min, tm.tm_sec, 0);
792 time.assign(s);
793 }
779 #endif 794 #endif
780 795
781 796
782 std::string Toolbox::StripSpaces(const std::string& source) 797 std::string Toolbox::StripSpaces(const std::string& source)
783 { 798 {