1
Answer

How to set date format in ASP.NET MVC Model Class?

I am using properties in the model class as given below.

        [Display(Name = "Start Date")]
        [DataType(DataType.DateTime)]
        public string startDate { get; set; }

and getting the date format as "2022-07-27T18:20" but I want the DateTime format as "Tue Jul 26 2022 16:42:01 GMT+0530".
Please suggest a way to achieve this DateTime format.
 

Answers (1)