i have linq query i want to convert the entrance date in the select new linq query, this is the query:
var query = (from con in db.Containers
join v in db.Vehicles on con.cont_vehicleid equals v.vehl_VehicleID
join cust in db.Custom_Captions on v.vehl_state equals cust.Capt_Code
where cust.Capt_Family == "vehl_state" && v.vehl_state!= "Incoming" && v.vehl_Deleted == null && con.cont_Deleted == null && v.vehl_ClearanceCompany == p.pusr_CompanyId
select new
{
cont_name = con.cont_Name,
vehl_Name = v.vehl_Name,
VehicleState = cust.Capt_AR,
vehl_drivername = v.vehl_drivername,
vehl_entrancedate = v.vehl_entrancedate,
vehl_customsdec = v.vehl_customsdec,
cont_rampid = v.vehl_rampid
}
);
how to convert the:
vehl_entrancedate = v.vehl_entrancedate,
as 24 hour??
the output form the previous code:
But,i want to display with 24 hour and without AM/PM like this :9/26/2016 11:55:58
or if the the time is 4:00 PM it will display 16:00
Note that the entrancedate field is type of datetime in database.