Convert minuts to time

Posted by Suneel161 under Regular Expressions on 5/20/2011 | Points: 10 | Views : 1457 | Status : [Member] | Replies : 5
Hi..

how to convert minuts to time.i am getting 1750 minuts ,then convert this minuts to time




Responses

Posted by: Susanthampy on: 5/20/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Try this,

DateTime t = new DateTime(0, 0, 0, 11, 21, 21);

double minutes = t.TimeOfDay.TotalMinutes;


int minutes = (int)Math.Floor(t.TimeOfDay.TotalMinutes);


totalMins = (60 * hrs) + mins + (secs / 60)


Regards,
Susan

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: T.saravanan on: 5/20/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Try this...

string sTime = DateTime.Now.ToShortDateString();

sTime = DateTime.Parse(sTime).AddMinutes(1750).ToShortTimeString();


Thanks,
T.Saravanan

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suneel161 on: 5/20/2011 [Member] Starter | Points: 25

Up
0
Down
hi saravanaa,

sTime is currentdate?

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suneel161 on: 5/20/2011 [Member] Starter | Points: 25

Up
0
Down
hi saravanan,

thanks its working fine.

suneel

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 5/20/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
Try to use timespan for this , you can get everything day, hour, minutes etc.
TimeSpan tspan = new TimeSpan(0,1750,0);

Thanks.
Debata

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response