7
Reply

how to give Calendar1.SelectedDate ?

Vasu Gadhiya

Vasu Gadhiya

Sep 5 2013 4:29 AM
1.3k
I have use Calendar Control,

-------------------------------------------
void Calendar1_Load()
{
Calendar1.SelectedDate = DateTime.Today;
}
-------------------------------------------

it complete working but server return US Time. So i convert into india time

-------------------------------------------
void Calendar1_Load()
{
TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
         DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE);
Calendar1.SelectedDate =  ?
}
-------------------------------------------

but i don't Know how to set indiantime as selected date.

Thanks in advance.

Answers (7)