Home > Forum > ASP.NET > how to calculate hours for 29 days in asp.net using c#

how to calculate hours for 29 days in asp.net using c#

by celv   on Mar 09, 2015   Category: ASP.NET  |  Views: 1177    |  Points: 5   |  Bronze 
  Reply
need to calculate the hours for 29 days per day working hours is 7.30
i need output like this 217.30
but am getting 212.10 like this how to calculate this

i calculate like this 7.30*29=211.7(i show 212.10) but its wrong


how to calculate hours for 29 days in asp.net using c#

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :how to calculate hours for 29 days in asp.net using c#   
by Thamil
on Mar 10 2015 12:15AM
Points : 10
Gold 
Hi Celv,

Try this below code.
TimeSpan tsCal = new TimeSpan(7,30,0);
tsCal = TimeSpan.FromTicks(tsCal.Ticks * 29);
Console.WriteLine("Hours->" + (int)tsCal.TotalHours + " Minutes->" + tsCal.Minutes);
Console.ReadLine();


Thanks.

Recent Post

Latest Posts