getting both time and date from calendar control
hi i am using calender control in asp.net. in this i want to get both current time and current date. how开发者_开发知识库 can i do this? i am using the language c#. help me
Yes we can with an amendment.. Example
DateTime dt = Convert.ToDateTime(Calendar1.SelectedDate.ToShortDateString());
TimeSpan ts = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
dt=dt.Add(ts);
txtreffDt.Text = dt.ToString();
You can't. The ASP.Net Calendar is just that - a calendar. Calendars only deal with dates. You'll need a third party DateTimePicker
control or similar.
精彩评论