How to add an hour to a timespan. C#
I have my timespan for a specific reason so it HAS to be in that format.
Im trying to add an hour on to the current time. Here is what I got which
does not work :/
TimeSpan time1= TimeSpan.FromHours(1); // my attempt to add 2 hours
TimeSpan ts = DateTime.Now.TimeOfDay;
ts.Add(time1);
MessageBox.Show(ts.ToString()); // for showing me what its
resulting..
Can you please advise?
No comments:
Post a Comment