开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜