检查此代码的错误 [英] Check the error for this code
本文介绍了检查此代码的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请检查此代码:
<%=System.DateTime.Now%> &"-"& <%# Eval("Submit_date")%>
但这不能改变日期
请帮忙
在此先感谢
<%=System.DateTime.Now%> &"-"& <%# Eval("Submit_date")
在此代码中,Submit_date
也是日期时间格式
都显示了两个日期,但没有区别
它给出这样的输出
在6/8/2011 4:58:58 PM &"-"& 3/26/2011 6:22:17 PM
解决方案
您无法像您采用的方法那样获得日期差.您必须先将Submit_date字段转换为DateTime才能计算出差异,您可以在此处找到更多详细信息
http://www.c-sharpcorner.com/UploadFile/DipalChoksi/DateDiff_CS_DC09132006172429_/DateDiffx /a> [^ ]
希望这会有所帮助.
我的建议是最好的方法是,您可以在后面的代码中更改日期. > this [ ^ ]可能有帮助您.
Please check this code:
<%=System.DateTime.Now%> &"-"& <%# Eval("Submit_date")%>
But it can''t difference the date
Please help
Thanks in advance
<%=System.DateTime.Now%> &"-"& <%# Eval("Submit_date")
In this code Submit_date
is also in date time format
both date are shown but it can''t do the difference
it give the output like this
On 6/8/2011 4:58:58 PM &"-"& 3/26/2011 6:22:17 PM
解决方案
Hi,
You cant get date difference like the approach you adopted. You have to convert Submit_date field to DateTime before calculating the difference,You can find more details here
http://www.c-sharpcorner.com/UploadFile/DipalChoksi/DateDiff_CS_DC09132006172429PM/DateDiff_CS_DC.aspx[^]
Hope this will help.
hi,
my advise is better you can do difference date in code behind...
Hope this[^] might help you.
这篇关于检查此代码的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文