Only want Date portion of DateTime
<%= Model.STPData.InitialRateSettingDate.HasValue ? Model.STPData.InitialRateSettingDate.Value.ToString() : "" %>
This shows both the date and the timestamp. I tried using only the .Date
property but it didn't work. How can I remove the time portion and display the date 开发者_开发知识库as a string only?
DateTime has a .ToShortDateString()
method
精彩评论