public void GetTiming()
{
ArrayList aTime = new ArrayList();
int interval = Convert.ToInt32(txtTimeInterval.Text);
DateTime EndTime = Convert.ToDateTime(txtEndTime.Text);
DateTime StartTime = Convert.ToDateTime(txtStartTime.Text);
for (int i = interval; i <= 1440+1; i++ )
{
if (StartTime != EndTime)
{
aTime.Add(StartTime.ToString("HH:mm"));
StartTime = StartTime.AddMinutes(interval);
}
else if (StartTime == EndTime)
{
aTime.Add(StartTime.ToString("HH:mm"));
break;
}
}
chkTiming.DDList.DataSource = aTime;
chkTiming.DataBind();
chktime.Visible = true;
}
No comments:
Post a Comment