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

Display current time in date picker

3 Answers 117 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
vina
Top achievements
Rank 1
vina asked on 03 Nov 2010, 10:16 AM
Hello...

I am using DatePicker control among to display date and current time. Please tell me what changes i need to do for display current time .

Thanks!

Vina.

3 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 03 Nov 2010, 10:41 AM
HI,

You can achieve your goal with setting required format of the DatePicker, like so:

<%= Html.Telerik().DatePicker()
        .Name("DatePicker")
        .Format("M/dd/yyyy h:mm tt") %>

Regards
Peter
0
vina
Top achievements
Rank 1
answered on 03 Nov 2010, 10:43 AM
I tried that but it takes time as 00:00:00 AM. It is not displaying the current time.

Thanks
Vina
0
Tony
Top achievements
Rank 1
answered on 04 Nov 2010, 04:21 PM
I did it like this,

 

<%= Html.Telerik().DatePicker()
    .Value(System.DateTime.Now.ToString())                       
    .Name("SelectedDateAdv")                        
%>
Tags
Date/Time Pickers
Asked by
vina
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
vina
Top achievements
Rank 1
Tony
Top achievements
Rank 1
Share this question
or