Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: DateTimeUpDown Custom Format

$
0
0
You seems to use the DateTimePicker to "format" data. You should use standard data API to acheive your need:
DateTime myTime = dtp.Value;
return myTime.ToString("yyyy-MM-dd");
But if that was not the point to your question, you may have more success with this return statement:
DateTimePicker myDTP = new DateTimePicker();
myDTP.Format = DateTimeFormat.Custom;
myDTP.FormatString = "yyyy-MM-dd";
myDTP.Value = dtp.Value;
return myDTP.Text;

Viewing all articles
Browse latest Browse all 2157

Trending Articles