My Desired output :
if the difference is less than a minute the result should be "Updated just now" and if the difference is than greater than a minute and less than an hour then the result should be "Updated X mintues ago"
Code:
string result = "";
if (difference.Days == 0)
{
if (difference.Hours == 0)
{
if (difference.Minutes == 0)
{
result = "Updated just now";
}
else
{
result = "Updated " + difference.Minutes.ToString() + " minutes ago";
}
}
else
{
result = "Updated " + difference.Hours.ToString() + " hours ago";
}
}
else
{
result = "Updated " + difference.Days.ToString() + " days ago";
}