LINQ convert datetime to shortdate and order accending
Peter Newman
66
Reputation points
I am trying to add a list of dates to a viewbag
despite several attempts I'm still not getting anywhere
currently the list that produced from my query is
26/11/2021 00:00:00
25/11/2021 00:00:00
24/12/2021 00:00:00
29/11/2021 00:00:00
I'm trying to get to
24/11/2021
25/11/2021
29/11/2021
24/12/2021
my query
ViewBag.closeddateslist = (From d In db.new_closeddates Order By d.new_date Ascending Select d.new_date).ToList()
Class
Public Property new_date As Nullable(Of Date)
The public property cannot be changed
Developer technologies | ASP.NET | Other
3,601 questions
Sign in to answer