2

I have a form that contains a Datepicker and in the email that is sent on submission the date is formatted with a time.

How do I remove the time from the date?

Thanks

4

1 回答 1

2

您可以将属性更改为 just Date,不带时间元素,也可以使用C# 内部 ToString()的方法: https ://msdn.microsoft.com/en-us/library/zdtaw1bw(v=vs.110).aspxDateTime

没有时间的格式看起来像这样:

yourDate.ToString("DD/MM/YYYY");
于 2016-08-15T14:17:42.597 回答