Good Afternoon
Where I can't find info about a counter to convert it in day,hour, min & seconds
Convert Counter to Day Hours Mins & Sec
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
AlanRank #669 · 3.6K reputationPosted Jul 29, 2008, 3:18 AM EDT
If 'counter' is counting down in seconds, then you can use:
TimeSpan ts = new TimeSpan(0,0, counter);
int days = ts.Days;
int hours = ts.Hours;
int mins = ts.Minutes;
int secs = ts.Seconds;
If it's counting down in milliseconds, then use:
TimeSpan ts = new TimeSpan(0,0, counter/1000);
// etc