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

Problem

1 Answer 33 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
immad
Top achievements
Rank 1
immad asked on 17 Jul 2013, 06:26 AM

Hello,

i am using telerik time picker in asp.net application.

i am using this syntax to save time picker data in database

 timein.text;

but its not giving me Text Property in time picker. 

and also giving me this error

'Telerik.Web.UI.RadTimePicker' does not contain a definition for 'text' and no extension method 'text' accepting a first argument of type 'Telerik.Web.UI.RadTimePicker' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\Desktop\Server\Attendance System\Attendance\ShiftDefine.aspx.cs 116 36 Attendance

can u provide me a Syntax

Thanks



1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Jul 2013, 10:59 AM
Hi immad,

The RadTimePicker does not have any Text property. Please have a look at the following C# code to get the selected time.

C#:
string time1 = RadTimePicker1.SelectedTime.ToString(); //time in 24 hour format

Suppose you want to get the time in 12 hour format, try the following C# code.

C#:
TimeSpan timespan = RadTimePicker1.SelectedTime.Value;
DateTime time = DateTime.Today.Add(timespan);
string displayTime = time.ToString("hh:mm tt");

Thanks,
Shinu.
Tags
Calendar
Asked by
immad
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or