2013-12-20 60 views
0

我只需要在vb.net中顯示日期。這些是我經歷的步驟。如何僅在vb.net中顯示日期

  1. 將日期添加到sql數據庫。 (sql數據庫顯示2013-12-13)
  2. 創建了一個表來查看它。 (顯示2013年12月13日12:00:00 AM)

我用的方法是:

<%=Formatdatetime(f_purchasedate,2)%> 
<%=FormatDateTime(f_purchasedate, "Short Date")%> 
<%Response.Write(FormatDateTime(f_purchasedate, 2))%> 

請幫助。謝謝

編輯:看錯了地方。這<%= Formatdatetime(f_purchasedate,2)%>起作用。感謝您的幫助球員

回答

1

嘗試這個

<%=Formatdatetime(f_purchasedate,2)%> 
<%=FormatDateTime(f_purchasedate, "Short Date")%> 
<%Response.Write(FormatDateTime(f_purchasedate, DateFormat.ShortDate))%> 

OR

<%Response.Write(f_purchasedate.ToString("yyyy-MM-dd")))%> 
+0

你有沒有試過? –

+0

它不會出現 – Rob