I'm using a TextBox/CalendarExtender to enter a date that's databound to a database. When I published the site to my production server (three hours earlier due to time zone), the date displayed in the TextBox that's manipulated by the CalendarExtender is decremented by one.
In the attached file, there are two TextBoxes. The first is just a plain TextBox, the second has a CalendarExtender attached to it. In the Page_Load handler I'm populating both TextBoxes and the CalendarExtender' SelectedDate property with that date (note I'm using Feb 1, 2008 for the example, but it's arbitrary).
This works great if you run it on a computer configured for that timezone or eastward. But if you go west, the second textbox is initialized with the previous day. Experiments in formatting indicate that the time associated with both TextBoxes is 00:00:00.000
This has become a show-stopper for me. My host server is on the East Coast, I'm on the West Coast. CalendarExtender loses an hour and I can't work around it!
Steps To Recreate: Host the attached file on one machine. On another computer (or Virtual PC instance), set the timezone to be at least one hour later (go west, i.e. from UTC-8 to UTC-9 or UTC-10). The second TextBox is initialized with 1/31/2008 instead of 2/1/2008!
Comments: "What I have found is that this issue is related specifically to setting the selectedDate property. When this is done, the date is serialized to a date time string at midnight in the server's timezone but converted to GMT." Well, this is certainly a mistake. GMT is defined as 12 AM of the day, not midnight. The time zones then have up to +/- 12 hours without change of day. Therefore, if there is no special time of day to set, the default must be 12 AM.
In the attached file, there are two TextBoxes. The first is just a plain TextBox, the second has a CalendarExtender attached to it. In the Page_Load handler I'm populating both TextBoxes and the CalendarExtender' SelectedDate property with that date (note I'm using Feb 1, 2008 for the example, but it's arbitrary).
This works great if you run it on a computer configured for that timezone or eastward. But if you go west, the second textbox is initialized with the previous day. Experiments in formatting indicate that the time associated with both TextBoxes is 00:00:00.000
This has become a show-stopper for me. My host server is on the East Coast, I'm on the West Coast. CalendarExtender loses an hour and I can't work around it!
Steps To Recreate: Host the attached file on one machine. On another computer (or Virtual PC instance), set the timezone to be at least one hour later (go west, i.e. from UTC-8 to UTC-9 or UTC-10). The second TextBox is initialized with 1/31/2008 instead of 2/1/2008!
Comments: "What I have found is that this issue is related specifically to setting the selectedDate property. When this is done, the date is serialized to a date time string at midnight in the server's timezone but converted to GMT." Well, this is certainly a mistake. GMT is defined as 12 AM of the day, not midnight. The time zones then have up to +/- 12 hours without change of day. Therefore, if there is no special time of day to set, the default must be 12 AM.