programmerist 1983
asked on
how to convert MM/dd/YYYY hh:mm:ss AM to YYYY-MM-dd datetime format by linq?
i have a data from database which includes some columns. one of them is ExpiryDate. it has SAP datetime format : MM/dd/YYYY nn:mm:ss AM
i wanna convert it from MM/dd/YYYY hh:mm:ss AM to YYYY-MM-dd . Is it possible?
is it possible by using linq?
i wanna convert it from MM/dd/YYYY hh:mm:ss AM to YYYY-MM-dd . Is it possible?
deliveriesItemsbypaging.Convert(q => q.ExpiryDate.ToString("yyyy-MM-dd")).Tolist() <DeliveryItem>;
is it possible by using linq?
Why use LINQ?
Probably better to format the date as you want in the SQL query at database level.
Probably better to format the date as you want in the SQL query at database level.
Hi,
Can you please try like.. Change the format when you are binding the data to the grid
Hope it helps!
Can you please try like.. Change the format when you are binding the data to the grid
DateTime dts = DateTime.Now;
var dv = dts.ToString("yyyy-MM-dd")
Hope it helps!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Pls try this..
Open in new window
Hope it helps!