02 August 2006

Convert a string to TimeSpan

How to Convert a string to TimeSpan in C#


To convert a string with hours, minutes and seconds to a time span, use:

TimeSpan.Parse("00:30:00");

8 comments:

Anonymous said...

Thank you! Your solution worked for me.

reillyp59

Unknown said...

Thank U So Much.....It helped me a lot!!!!

Anonymous said...

Thank you for your help...it's save me

Anonymous said...

Awesome little tip :)

vinnu said...

Thanks.. It worked..

Anonymous said...

Thanks a lot!

Anonymous said...

Thanks a lot. It was really helpful..

Anonymous said...

Thank you very much. Very helpful post especially for Time Attendance system.
Help me compute hours directly from textbox entry with time format only.