2013-12-20 58 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