Building an MVC app in Visual Studio. When I test it (run locally in IIS Express) it shows the datetime.tolongdatestring() format correctly. When I publish the site, it is showing the correct Date, but in a Basic format like February-18-2016 rather than the long format.
Site is published on my web server running IIS 7.0, Server 2K8 Standard. Probably something to do with culture or regional settings but please point me in the right direction....
Below is a portion of my model. As mentioned, the string DisplayDate below displays the proper format with the day of the week when run locally, published site does not. Have tried from multiple locations, platforms, etc.
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
public DateTime DateAndTime { get; set; }
//Display long date format
public string DisplayDate { get { return (DateAndTime.ToLongDateString()); } }