I want to create a method it returns string and (calculate the period expires days) differences between expires date and current date.
if the differences is less than 1 minutes i will return in second ex: 8 seconds
if the differences is less than 1 hours i will return in minutes ex: 28 minutes
if the differences is less than 24 (a day) hours i will return in hours ex: 7 hours
default if not matches any case I will return days ex: 3 days
what I have already tried is
(item.EndDate- DateTime.Today).Days
But is does not work when the difference less than 24 hours it will return 0.
Can you give me suggestion?