我如何格式化从数据库中抽取的日期? [英] How do I format a date pulled from a database?
问题描述
我试图拉从数据库中的日期,并把它放在网页的下方code:
< ASP:标签ID =LABEL3=服务器文本='<%#的eval(TravelDate)%>' />< BR />< BR />
据拉没有问题的日期,但是当它显示在页面上,不管它是如何在数据库格式,它似乎要永远显示日期为2013年6月17日12:00: 00AM。是否有什么我失踪在我必须使用格式化日期VS部分?我想preFER2013 6月17日,但接近,在访问唯一的选择就是它增加了星期几在它前面。摆脱的时间是非常重要的。
< ASP:标签ID =txtDateWIDTH =65px=服务器FONT-SIZE = 8.5pt前景色=#000f9f
文字='<%#的eval(How_date,{0:DD / MMM / YYYY})%GT;'>< / ASP:标签>
I am trying to pull a date from database and putting it on a webpage with the below code:
<asp:Label ID="Label3" runat="server" Text='<%# Eval("TravelDate") %>' /><br /><br />
It pulls the date with no problem, but when it shows up on the page, no matter how it is formatted in the database, it seems to want to always display the date as "6/17/2013 12:00:00am". Is there something I'm missing in the VS portion that I have to use to format the date? I'd prefer "June 17, 2013", but the only option close to that in Access is where it adds the day of the week in front of it. Getting rid of the time is important.
<asp:Label ID="txtDate" Width="65px" runat="server" Font-Size="8.5pt" ForeColor="#000f9f"
Text='<%# Eval("How_date","{0:dd/MMM/yyyy}") %>'></asp:Label>
这篇关于我如何格式化从数据库中抽取的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!