Jibu P C_Adoor
Jibu P C_Adoor

Reputation: 3364

Convert specified format of time to a date asp.net

Hii,

I have time, for e.g 33 hr 40 mins 50 secs . i would like to convert it to a date time format.

for e.g I have used Convert.ToDateTime("33:40:50"), but in this case when you converting to date time, hour should be less than 24, otherwise it will fire an exception. Pls help me to solve the above problem.

Upvotes: 0

Views: 114

Answers (1)

Anton Gogolev
Anton Gogolev

Reputation: 115897

Try TimeSpan.Parse():

a time interval specification of the form: [ws][-]{ d | [d.]hh:mm[:ss[.ff]] }[ws]

Upvotes: 2

Related Questions