Vijay Pratap Singh

Vijay Pratap Singh

  • 349
  • 4.7k
  • 438.3k

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

Jul 27 2022 12:58 PM

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)