日期:2014-05-18  浏览次数:20616 次

Calendar 控件日期格式问题
 
<asp:Calendar ID="myCalendar" .......>控件

Select Case (Me.myCalendar.SelectedDates.Count)
  Case 0 'None
  Me.lb6.Text = "您目前没有选取任何日期..."
  Case 1 'Day
  Me.lb6.Text = "您所选取的日期是:" & myCalendar.SelectedDate.ToShortDateString
得的值为2008-10-23 怎么把格式变为2008.10.23请问format要怎么用?
  Case 7 'Week
  Me.lb6.Text = "您选取了一整个星期,此周的开始日期是:" & myCalendar.SelectedDate.ToShortDateString
  Case Else 'Month
  Me.lb6.Text = "您选取了一整个月份,此月份的开始日期是:" & myCalendar.SelectedDate.ToShortDateString
  End Select

------解决方案--------------------
mycalendar.replace("-",".")
------解决方案--------------------
myCalendar.SelectedDate.ToString("yyyy.MM.dd")
------解决方案--------------------
myCalendar.SelectedDate.ToString("yyyy.MM.dd")