How can I convert a datetime to dd-mmm-yyyy Date format?
-
22-08-2019 - |
Question
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?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow