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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -