hi to all,
here i'm set a field name startdate in textbox but the date format will takes(MM:DD:YYYY) now i want to change (DD:MM:YYYY).can anybody help for this task.
in modal:
[DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] public Nullable<System.DateTime> Start_date { get; set; }
IN VIews:-
@Html.TextBoxFor(m => m.Start_date, "{0:dd/MM/yyyy}")
Above code not work for me . Kindly help me please
How to set the date format while typing in textbox in mvc 5
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Guest UserRank #259 · 9.8K reputationPosted Jul 25, 2014, 2:28 AM EDT
Anupam SinghRank #643 · 3.7K reputationPosted Jul 25, 2014, 4:08 AM EDT
DataFormatString = @"{0:dd\/MM\/yyyy}" instead of DataFormatString = "{0:yyyy-MM-dd}.
jothi kumar102 reputationPosted Jul 25, 2014, 8:44 PM EDT