Thread Sekunden in Stunden,Minuten,Sekunden umwandeln
(3 answers)
Opened by SirLant at 2004-04-14 03:11
Hab ich esskar:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 class CUptime { public: CUptime(long time = 0); ~CUptime(void); //Memberfunktionen void setTime (long time); CString getTime (void); protected: int hours; int mins; int secs; }; #include <ctime> CUptime::CUptime(long time /* = 0 */) { setTime (time); } CUptime::~CUptime(void) { } void CUptime::setTime (long time) { secs = time % 60; time -= secs; time /= 60; mins = time % 60; time -= mins; time /= 60; hours = time; } CString CUptime::getTime (void) { CString str; str.Format ("%02d:%02d:%02d", hours, mins, secs); return str; } Edit: Irgendwie mag das Board die Tabs nicht\n\n <!--EDIT|SirLant|1081900046--> --Programming today is a race between Software Enginers striving to build bigger and better idiot-proof Programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning! |