在你的网格视图中添加名为的属性 DataFormatString
DataFormatString示例:
{0:dd MMMM yyyy} - gives 24 February 2006
{0:MMM dd} - gives Feb 24 (substitue MMM with MMMM for the full month name
instead of abbreviation)
{0:dd/MM/yy} - gives 24/02/06
{0:dd/MM/yyyy} - gives 24/02/2006
示例代码
<asp:BoundField HeaderText="Date"
DataField="SampleDate"
DataFormatString="{0:MM/dd/yyyy}" >
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
24089 次 |
| 最近记录: |