TimeSpan
TimeSpan.Add
DateTime dt = DateTime.Now; String s = "+5"; // or "-5" works with both + and - dt = dt.AddHours(Convert.ToInt32(s));
DateTime clientTime = System.Date.Now; string hrsToCompute = "+5"; int final = 0; if(hrsToCompute.IndexOf("+")) { final = Convert.ToInt32(hrsToCompute.Substring(1)); clientTime.AddHours(hours); } //same logic here for negative.....
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)