You should not be splitting up the String representation of the date returned by the DateTimePicker's .Text property.
Instead, work with the DateTimePicker's .Value property which returns a Date and manipulate that using the methods and properties of the DateTime Structure.
Use the DateTime's Day, Month and Year properties if you need Integer values.
If you need String values, then use its ToString method, passing the required Format String as an argument.
For example
vb.net Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dt As DateTime = DateTimePicker1.Value Dim day As Integer = dt.Day Dim month As Integer = dt.Month Dim year As Integer = dt.Year Dim dayString As String = dt.ToString("dd") Dim monthString As String = dt.ToString("MMMM") Dim yearString As String = dt.ToString("yyyy") MessageBox.Show(String.Format("{0}{6}{1}{6}{2}{6}{6}{3}{6}{4}{6}{5}", _ day, month, year, dayString, monthString, yearString, _ Environment.NewLine)) End Sub
which, in English speaking cultures, will give values like:
Integers:
17
2
2013
Strings:
17
February
2013




Reply With Quote