General information
Category:
Coding, syntax and commands
Title:
Geting a date from Calendar Control
I have a calendar control and a text box on a Web form, but the ist character is being dropped from the date (if the day has 2 digits)
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
txtDate1.Text = Calendar1.SelectedDate.Date.ToString().Substring(1,10);
}
If date is 9/07/2006 ok , but for 28/07/2006 it moves 8/07/2006
I've tried increasing the Sibstring to (1,11) but it starts movng the time bit.
Any help appreciated
Regards,
Gerard
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only