This post was most recently updated on March 15th, 2016
Get Datetime in string in linq Query
1) using System.Data.Entity.SqlServer;
2)
1 2 3 |
LastUpdateDateTimeInString = techofeature.LastUpdated == null ? string.Empty : SqlFunctions.StringConvert((decimal)techofeature.LastUpdated.Value.Year).Trim() + "/" + SqlFunctions.StringConvert((decimal)techofeature.LastUpdated.Value.Month).Trim() + "/" + SqlFunctions.StringConvert((decimal)techofeature.LastUpdated.Value.Day).Trim() + " " + SqlFunctions.StringConvert((decimal)techofeature.LastUpdated.Value.Hour).Trim() + ":" + SqlFunctions.StringConvert((decimal)techofeature.LastUpdated.Value.Minute).Trim() + ":" + SqlFunctions.StringConvert((decimal)techofeature.LastUpdated.Value.Second).Trim() |
3) Convert datetime string in jquery
Date d =New Date(LastUpdateDateTimeInString)