+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Events: Can't set StartDate or EndDate correctly

Events: Can't set StartDate or EndDate correctly

15 posts, 0 answered
  1. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    04 Jan 2011
    Link to this post
    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
  2. Petya
    Petya avatar
    123 posts
    Registered:
    17 Oct 2016
    17 Jan 2011
    Link to this post
    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,
    Petya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    17 Jan 2011
    Link to this post
    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
  4. Petya
    Petya avatar
    123 posts
    Registered:
    17 Oct 2016
    17 Jan 2011
    Link to this post
    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,
    Petya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. ZK
    ZK avatar
    23 posts
    Registered:
    23 Nov 2010
    25 Jan 2011
    Link to this post
    I am experiencing the same issue. I've attached internal.png, a screenshot of the currently entered date and time for an event, and external.png which shows the date and time as displayed on the published page. Was this ever resolved with Phill?

    Thanks,
    Zak
  6. Petya
    Petya avatar
    123 posts
    Registered:
    17 Oct 2016
    27 Jan 2011
    Link to this post
    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,

    Petya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Tonya
    Tonya avatar
    5 posts
    Registered:
    23 Sep 2003
    17 Mar 2011
    Link to this post
    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.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 Mar 2011
    Link to this post
    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
  9. Jason
    Jason avatar
    8 posts
    Registered:
    22 Jul 2010
    23 Mar 2011
    Link to this post
    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?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Mar 2011
    Link to this post
    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
  11. Jason
    Jason avatar
    8 posts
    Registered:
    22 Jul 2010
    29 Mar 2011
    Link to this post
    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.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Apr 2011
    Link to this post
    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
  13. Josh Anderson
    Josh Anderson avatar
    48 posts
    Registered:
    15 Dec 2005
    14 Nov 2012 in reply to Ivan Dimitrov
    Link to this post
    I'd like to put my $0.02 in on this conversation. I would like to see one of two options:
    • Dates on Events stored as entered, with no conversion to UTC
    • The ability to specify the time zone on the event itself
    The issue we have is that not all our events occur or should be displayed in our local time zone. We may do a west coast event that we want to display in PST. Since many of our events are physical gatherings, not webinars, it's pretty important that the time be displayed as local to the place where the event is happening.

    For now, we'll just have to hack the date to make it show the correct date, but this solution is far from ideal.

    Josh
  14. Nicolas
    Nicolas avatar
    156 posts
    Registered:
    19 Jan 2011
    16 Nov 2012
    Link to this post
    Hi,

    it's an old issue : 
    http://www.sitefinity.com/devnet/forums/general-discussions-/events-date-start-and-end


    Regards,
    Nicolas
  15. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    17 Nov 2012
    Link to this post
    Hello Josh,

    Thank you for your feedback. I have created a feature request in PITS.

    Regards,
    Randy Hodge
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
15 posts, 0 answered