I'm receiving the following exception when I try to use a custom format in my DateTimePicker
:
"The string was not recognized as a valid DateTime."
I'm using the following snippet :
dtpSystemAdjustmentDate.Format = DateTimePickerFormat.Custom;
dtpSystemAdjustmentDate.CustomFormat = "mm.dd.yyyy hh:mm:ss";
I've found documentation on the Microsoft help pages : http://msdn.microsoft.com/en-us/library/aa983603%28v=vs.71%29.aspx
I Tried this snippet :
// C#
dateTimePicker1.CustomFormat = "'Today is:' hh:mm:ss dddd MMMM dd, yyyy";
I'm receiving also an exception, complaining about "Today" being a keyword that is not recognized.
I suspect something related to culture (my current Culture is fr-CH
) but I can't find a way to make it work... Any idea ?