locked
Change default time RRS feed

  • Question

  • User-39953368 posted

    Hi,

    how can I change the default time on calendars from 1/1/1753 (!) to 2007?

    Thanks.

    Monday, December 10, 2007 3:58 PM

Answers

  • User555306248 posted
    The following example sets TodaysDate to today then sets the SelectedDate to TodaysDate
    DateTime today = DateTime.Today;
    Calendar1.TodaysDate = today;
    Calendar1.SelectedDate = Calendar1.TodaysDate;
    
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 10, 2007 10:27 PM

All replies

  • User555306248 posted
    The following example sets TodaysDate to today then sets the SelectedDate to TodaysDate
    DateTime today = DateTime.Today;
    Calendar1.TodaysDate = today;
    Calendar1.SelectedDate = Calendar1.TodaysDate;
    
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 10, 2007 10:27 PM
  • User-39953368 posted

    Thanks for the reply. The culprit was sqlDateTime.Minvalue which is 01/01/1753 (in defaults.cs).

    Tuesday, December 11, 2007 1:58 PM
  • User555306248 posted

    Thanks very much

    Wednesday, December 19, 2007 10:28 PM