本文介绍了如何将日期时间转换为dd-mmm-yyyy日期格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将Webdatechooser<<Infragistics control>>
用于需要日期时间的列.我需要将通过Webdatechooser输入的值转换为dd-mmm格式.
I'm using Webdatechooser<<Infragistics control>>
for a column which takes the datetime.I need to convert the value entered (through the Webdatechooser) to dd-mmm-format.
我可以为此提供片段吗?
Can I have snippets for that?
推荐答案
该值是DateTime对象,因此您可以使用该对象的ToString函数生成所需的输出.
The value is a DateTime object so you can use the ToString function of that object to generate the desired output.
((DateTime)WebDateChooser1.Value).ToString("dd-MMM-yyyy");
应该这样做.
这篇关于如何将日期时间转换为dd-mmm-yyyy日期格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!