Friday, 6 September 2013

Parse hour and AM/PM value and add to existing time

Parse hour and AM/PM value and add to existing time

Similar question like the already one Parse hour and AM/PM value from a
string - C# but i need some thing like this.
string input = "9:00 PM";
DateTime currentTime = DateTime.Now;
// Resultant time like this
currentTime.Add(input) // Just a sudo
If current datetime like 9/6/2013 3:18 AM then result would be like this
9/6/2013 9:00 PM How to achieve this. Thanks in advance.

No comments:

Post a Comment