如何在.aspx页中转换DateTime格式(dd/MM/yyyy) [英] How to Convert DateTime format(dd/MM/yyyy) in .aspx Page
本文介绍了如何在.aspx页中转换DateTime格式(dd/MM/yyyy)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
由于数据(列之一是TDate:DateTime/DataType)存储在表中.我想以格式(dd/MM/yyyy)显示TDate.
当我尝试Text =''<%#bind("TDate")%>''时.
解决方案
您可以在sql语句 ^ ]或之后以及使用DateTime.ToString(" dd/MM/yyyy)进行数据绑定之前在绑定表达式 http://msdn.microsoft.com/en-us/library/2d76z3ck.aspx [ ^ ]
Hi!
As the data(one of the column is TDate:DateTime/DataType) is stored in Table. I want to display the TDate in the Format(dd/MM/yyyy).
As I am trying Text=''<%# bind("TDate") %>''.
Could anyone please show me the required format?
解决方案
You can eithe convert the date in your sql statement, http://www.ehow.com/how_5804915_convert-date-format-transact_sql.html[^] or afterward and prior to databinding using DateTime.ToString("dd/MM/yyyy") or in the binding expression http://msdn.microsoft.com/en-us/library/2d76z3ck.aspx[^]
这篇关于如何在.aspx页中转换DateTime格式(dd/MM/yyyy)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文