How can you show the date in a gridview as a date only instead of a datetime?

前端 未结 10 1596
粉色の甜心
粉色の甜心 2021-02-04 01:22

I am pulling in date values from a sql server database using a gridview and and the date gets converted from

12/12/2009 to 12/12/2009 12:

10条回答
  •  青春惊慌失措
    2021-02-04 01:40

    Try the below code:

        
    

    In the above mentioned code, my_date is the date column of the sqlserver table. The DataFormatString="{0:d}" is the main portion of this code to resolve the particular issue of yours.

提交回复
热议问题