-3

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

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Carlos Iyu
  • 63
  • 6

2 Answers2

6

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

Like the following:

label1.text = DTPicker1.value.ToString("dd MMM yyyy");
Mafii
  • 7,227
  • 1
  • 35
  • 55
Gil Sand
  • 5,802
  • 5
  • 36
  • 78
0

Just add the date format to your .ToString() call:

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

Further information can be found on MSDN

Mafii
  • 7,227
  • 1
  • 35
  • 55