Basically, i need the equivalent of T-SQL CONVERT(NVARCHAR(10), datevalue, 126)
I've tried:
from t in ctx.table select t.Date.ToString("yyyy-MM-dd")
but it throws not supported exceptionfrom t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day
but i don't think it's an usable solution, because i might need to be able to change the format.
The only option I see is to use Convert.ToString(t.Date, FormatProvider)
, but i need a format provider, and I'm not sure it works either
FormatProvider doesn't work, String.Format doesn't work (string.Format("{0:yyyy-MM-dd}", t.Date)
throws not supported exception too).