Bootstrap Datepicker: Cannot implicitly convert type 'System.DateTime?' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?)
问题 I am a newbie here. I have gone through similar questions here but none of them helped. I have the following in my ViewModel : public DateTime FromDate { get; set; } public DateTime ToDate { get; set; } When I run the code, in the View after GET Method , I am getting the default dates as: 01/01/0001 , in other words, null /default value. I searched online and found out that I need to make these fields nullable . Therefore, I changed the above code to: public DateTime? FromDate { get; set; }