![](https://images2015.cnblogs.com/blog/859364/201606/859364-20160623103450453-1243546844.jpg)
![](https://images2015.cnblogs.com/blog/859364/201606/859364-20160623104358125-582141343.jpg)
using namespace std;
using namespace std::chrono;
milliseconds ms(7255042);
// split into hours, minutes, seconds, and milliseconds
hours hh = duration_cast<hours>(ms);
minutes mm = duration_cast<minutes>(ms % chrono::hours(1));
seconds ss = duration_cast<seconds>(ms % chrono::minutes(1));
milliseconds msec = duration_cast<milliseconds>(ms % chrono::seconds(1));
// and print durations and values:
cout << "raw: " << hh << "::" << mm << "::"
<< ss << "::" << msec << endl;
cout << " " << setfill(’0’) << setw(2) << hh.count() << "::"
<< setw(2) << mm.count() << "::"
<< setw(2) << ss.count() << "::"
<< setw(3) << msec.count() << endl;
raw: [2 of 3600/1]::[0 of 60/1]::[55 of 1/1]::[42 of 1/1000] 02::00::55::042