How can I convert a datetime to dd-mmm-yyyy Date format?

和自甴很熟 提交于 2019-12-11 19:43:16

问题


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?


回答1:


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");

Should do it.



来源:https://stackoverflow.com/questions/709982/how-can-i-convert-a-datetime-to-dd-mmm-yyyy-date-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!