Change Date into Month Name and Date with Year in C# -
i want convert date different. give input date, convert format.
my code
var dt = erd.startdate.value.toshortdatestring(); var format = string.format("{mmm/d/yyyy}", dt);
here showing error input string not correct format.
help me find out issue?
simply rewrite (i'm assuming erd.startdate.value datatype datetime)
string result = erd.startdate.value.tostring("mmm/dd/yyyy");
or using "d" equivalent "dddd, mmmm d, yyyy"
string result = erd.startdate.value.tostring("d");
Comments
Post a Comment