How to fix date format in ASP .NET BoundField (DataFormatString)?

前端 未结 7 1539

I have a dynamic BoundField (for a DetailsView) with the following code:

BoundField bf1 = new BoundField();
bf1.DataField = \"CreateDate\";
bf1.DataFormatStr         


        
7条回答
  •  迷失自我
    2020-12-30 22:03

    The following links will help you:

    In Client side design page you can try this: {0:G}

    OR

    You can convert that datetime format inside the query itself from the database:

提交回复
热议问题