convert string with am/pm to timespan c# code example

convert string with am/pm to timespan c#

1

1 Example

0
DateTime dateTime = DateTime.ParseExact(text,
                                    "hh:mm tt", CultureInfo.InvariantCulture);
TimeSpan span = dateTime.TimeOfDay;

Other Code Examples