Search code examples
c#datetimepicker

How to write a long date with datetimepicker values


How can I make the datatimepicker component can write long date ?

In my case , I want to show the amount in words on a label.

label1.text = DTPicker1.value.ToString();

Example :

input : 13/07/2016 out: 13 de July de 2016

My dataPicker Properties :

CustomFormat : dd MMMM yyyy 
Format : Custom

But even with this setting the value remains 13/07/2016 09:50 AM


Solution

  • Have you tried passing a format as a parameter of the ToString() call?

    Like the following:

    label1.text = DTPicker1.value.ToString("dd MMM yyyy");