Saturday, May 10, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

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();                

No comments :

Post a Comment

Contact Us

Name

Email *

Message *