I'm working on simple asp.net mvc website, that shows user's post. I'm saving the post details in the DB including uploaded date.
DateTime dateTimeNow = DateTime.Now;
newPost.Feed_Upload_Date = dateTimeNow;
DB.Post.Add(newPost);
DB.SaveChanges();
Now in my View when I'm showing the date, it shows me something like this
"1/21/2019 4:29:58 PM"
What I want to achieve is to convert this time in my Database into something like "1 day ago". Thanks.
@item.Feed_Upload_Date
} – Alaa Hershey Jan 22 '19 at 07:38