格式化datacolumn唯一日期 [英] format the datacolumn only date
本文介绍了格式化datacolumn唯一日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到datacolumn数据类型就像05/14/2013 6:48:03 PM但我不想要时间我想要显示日期(05/14/2013)所以请任何人帮帮我
问候
Sangamesh Arali
9591678357
Hi,
I am getting datacolumn datatype is like 05/14/2013 6:48:03 PM but i dont want time only I want to display date(05/14/2013) so please anybody help me out
Regards
Sangamesh Arali
9591678357
推荐答案
你可以使用String.Format函数。
You can use String.Format function.
String.Format("{0:MM/dd/yyyy}", "Your String goes here")
您好,
在您页面的页面加载事件中添加以下代码然后它将起作用
Hi,
Add below code in page load event of your page then it will work
CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
culture.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy";
culture.DateTimeFormat.LongTimePattern = "";
Thread.CurrentThread.CurrentCulture = culture;
问候
Sangamesh Arali
Regards
Sangamesh Arali
这篇关于格式化datacolumn唯一日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文