This is a migrated thread and some comments may be shown as answers.

Get String of DatePicker

4 Answers 87 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Nagiza
Top achievements
Rank 1
Nagiza asked on 24 Sep 2015, 07:49 AM
Hello

I am new in the community of Telerik

I want to get the string to select the date

example of test:

in frm.aspx

<telerik:RadDatePicker ID="RadDatePicker1" runat="server"></telerik:RadDatePicker>‚Äč

in frm.aspx.vb

 Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'here code!!
        Dim x As String
        x = RadDatePicker1.xxxxxx
        MsgBox(x)
    End Sub Dim x As String
      

how Get String of DatePicker??

sorry my english

 

 

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 24 Sep 2015, 11:10 AM
Hello Nagiza,

SelectedDate property returns an object of type DateTime? (nullable DateTime).

Protected Sub Button1_Click(sender As Object, e As EventArgs)
    Dim dateAsString As String = RadDatePicker1.SelectedDate.ToString()
        ....
End Sub

More detailed:
Protected Sub Button1_Click(sender As Object, e As EventArgs)
    Dim nullableDate As System.Nullable(Of DateTime) = RadDatePicker1.SelectedDate
    Dim [date] As DateTime = nullableDate.Value
    Dim dateAsString As String = [date].ToString()
End Sub

Let me know if you need more information.

Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nagiza
Top achievements
Rank 1
answered on 25 Sep 2015, 05:39 AM

Hello Daniel
thanks by help me,

in both codes:

get this "09/10/2015 12:00:00 a.m." but I just want the date
10/09/2015

 Regards

 

0
Daniel
Telerik team
answered on 25 Sep 2015, 07:03 AM
Hello Nagiza,

I would recommend that you examine the following link:
Standard Date and Time Format Strings

DateTime type is native to .NET Framework and the best way to find information about it is to look inside MSDN.

Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nagiza
Top achievements
Rank 1
answered on 25 Sep 2015, 07:33 AM

ok

thanks

Tags
DatePicker
Asked by
Nagiza
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Nagiza
Top achievements
Rank 1
Share this question
or