How to format a time-stamp to show the date only in a grid view

前端 未结 5 2389
南方客
南方客 2021-02-19 20:27

In an aspx page I am binding the labels like this:

  
            
                &l         


        
5条回答
  •  孤城傲影
    2021-02-19 20:54

    Text='<%# (Convert.ToDateTime((Eval("date_of_joining")))).ToShortDateString() %>'
    

    This is the simplest way I discovered.

提交回复
热议问题