Breaking News

Editors Picks

Thursday, June 28, 2012

Multiply Time in C#


  string a = "8:25";
  int n = 2;//multiply by
  string[] time = a.Split(':');
  string output = string.Empty;
  int c = (int.Parse(time[0]) * 60 + int.Parse(time[1])) * n;
  if (c % 60 == 0)
     { output = (c / 60).ToString(); }
  else
     output = (c / 60).ToString() + ":" + (c % 60).ToString();                
Read more ...

Contact Us

Name

Email *

Message *