Events: Can't set StartDate or EndDate correctly
Issues: Create a new event (the one and only event in the system) set the Start Date and Start Time to March 15, 2011 10am and it gets stored in the database as March 15 2011, 2pm. For some reason it adds 4 hours and the same happens to the End Date.
The last modified date as stored in the database is my current system time (developing locally so I know clock is right) is 5hrs ahead.
Finally, I change the pulished date to yesterday and that is stored in the database correctly, however when I debug and walk through the code, the Event object PublicationDate is giving me the LastModifiedDate.
Version: Current RC2 build
Not sure about other SF users, but an Event module that you can't actually set the date and time of your event is pretty useless.
Regards,
Phill
Hello Phill,
I couldn't reproduce your problem. All dates are stored in the database in UTC. So, for example, if you create an event with start date March 15, 2011, 10:00 am, and your time zone is UTC+2, in the database the time is stored as 8:00 am, which is a normal behavior.
Greetings,Hi Petya,
This is still an issue, can you try again and follow these steps:
1. Create an Event
2. Set Start DateTime to February 1st, 9:00:00 am
3. Set End DateTIme to February 1st, 9:00:01 am
4. Look this event up in the database and you'll see that the Start Date and End Date are an hour apart, not one second.
My goal here is to have an Event where the Start and End date are the same but the UI won't let me, which I think it should. The check should be >= not just > or I should be able to create an event with EndDate empty/null (i.e. a reminder vs. an event with a duration). You're explanation of the time offset makes sense, what was throwing me off is that the enddate is automatically being bumped by an hour.
Regards,
Phill
Hi Phill ,
I'm sending you an attachment how this event is created on my machine and how it is stored in the database. I still have problems reproducing your issue. Can you tell me what time zone settings and regional settings you are using. Also where is your SQL server located and what are its time settings.
According to your goal to create an event with equal start and end date - it's actually not possible to have some event starting and ending at the same time that's why the check is > not >= by design. Your other idea - to be able to create event with empty end date is acceptable for now, so we will log it as a new task which should be implemented
Best wishes,
Hi Zak,
I think that your problem is a little different than Phill's. The event start and end date appear on the public part in UTC, which is not correct - we already logged this as a bug with ID 105128 and it will be fixed in some of our next internal releases.
Greetings,
Has the UTC issue been fixed in a release yet? Can't believe during testing nobody created and event and then looked at it and noticed the date had been changed by hours.
Hi ,
The status of the issue is Not Done, but it with high priority and we are going to work on it. We will try to fix it for Q1.
Kind regards,
Ivan Dimitrov
the Telerik team
Storing the date/time in UTC wouldn't be an issue if it read the browser or system (server) localization correctly - which it doesn't.
For now is the suggested workaround to compensate the event time by whatever your local offset to UTC happens to be?
Hi Jason,
Could you check the values that are saved inside [sf_events] table for [event_end] and [event_start]? Generally this is the value that will be displayed by the public control. You can pass this value to the code below
public DateTime ToLocal(this DateTime value)
var timeZoneInfo = UserManager.GetManager().GetUserTimeZone();
return TimeZoneInfo.ConvertTime(value, timeZoneInfo);
This is what the public control returns if the Event_Start and Event_End are added by filed controls in the template you use.
Kind regards,
Ivan Dimitrov
the Telerik team
Hi Ivan,
The values are as follows:
[sf_events].[event_end]: 2011-02-09 20:00:00.000
[sf_events].[event_start]: 2011-02-09 18:00:00.000
In the default administration interface for the event (/Sitefinity/Content/Events):
Event End: 02/09/2011 2:00:00 PM
Event Start: 02/09/2011 12:00:00 PM
The General Settings for Time zone is set to "(UTC-06:00) Central Time (US & Canda)". While I understand that what your ToLocal() is doing, I still feel this is a bug since the data should be stored and displayed consistently.
Hello Jason,
Can you edit the template of the events widget and put the format to the FieldListView control with ID EventsDates
Format=
" | Event_Start.ToLocal(): dd MMM, '\''yy"
/>
All the best,
Ivan Dimitrov
the Telerik team
I'd like to put my $0.02 in on this conversation. I would like to see one of two options:
Hi,
it's an old issue :
www.sitefinity.com/.../events-date-start-and-end
Regards,
Nicolas
Hello Josh,
Thank you for your feedback. I have created a feature request in PITS.
Regards,
Randy Hodge
the Telerik team