Reputation: 666
I am working on a project and I need to calculate the days between date account created and current date. my code works how ever it is not giving me just the days. This below code
@(item.AccountCreated.AddYears(1)-DateTime.Now)
gives me this result like this 330.06:53:24.6752284 when all I want to be displayed would be 330 is there a way to do this through Razor.
Issue now resolved by doing
@Convert.ToInt32(((item.AccountCreated.AddYears(1)-DateTime.Now).TotalDays))
Upvotes: 0
Views: 5860