ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Entry date fields one hour off

March 05, 2012 10:58am

Subscribe [2]
  • #1 / Mar 05, 2012 10:58am

    Angus K

    14 posts

    Hi, wonder if you can help.

    On the site I’m building, http://newsite.instituteofideas.com/events/, there is a list of events with times taken from entry_date. Some of these display correctly (up to the end of Feb) but everything afterwards is showing one hour early. I don’t think this is a daylight savings issue is it? I have the server localisation set to eastern time (it’s engine hosting). Very frustrating.

    thanks
    Angus

    PS when I look at the page when I’m looked in the behaviour reverses: i.e. events after end of Feb are on the correct time; events before are an hour late.

  • #2 / Mar 06, 2012 12:06pm

    Shane Eckert

    7174 posts

    Hello Angus K,

    I am sorry to hear you are running into this problem.

    What version of ExpressionEngine are you currently running?

    Do you have daylight savings enabled?

    Would you mind pasting in your code from the template used to display these events? I would like to try and reproduce this.

    Thank you in advance!

    Cheers,

  • #3 / Mar 06, 2012 2:15pm

    Angus K

    14 posts

    Hi Shane, the code for the page (http://newsite.instituteofideas.com/events/) is below. I’m running EE 2.4.0. I’m in the UK but my localization settings are

    Server Time Zone: UTC -5
    DST: Yes

    thanks!
    Angus

    {preload_replace:my_channel="events"}
    {preload_replace:my_status="open"}
    {preload_replace:my_template_group="events"}
    
    {ioi_html_head}
    {embed="embeds/.embed_metatags" description="Institute of Ideas Events" title="Institute of Ideas - Events{exp:channel:entries show_future_entries="yes" channel="{my_channel}" status="{my_status}"}{if segment_2 == url_title} - {title}{/if}{/exp:channel:entries}"}
    {ioi_html_head_end}
    
    <body>
    
    <div id="wrapper">
    
     {embed="embeds/.embed_header" color="eventHeader"}
    
     <div id="content">
    
      <div id="colMain">
    
       <div id="pageTitle" class="eventHalf"><div class="title">IOI Events…</div></div>
    
       {exp:channel:entries channel="{my_channel}" status="{my_status}" show_future_entries="yes" orderby="entry_date" limit="7" paginate="bottom" disable=”member_data|categories|trackbacks”}
        
        {if segment_2 != url_title}
    
         {if count == "1"}
    
          <div id="pageFeature"  class="eventHalf">
           <h1>Don't Miss!</h1>
           {!-- show one event that has featured set to yes and is not in the past --}
    
           {embed="embeds/.embed_featuredEvent"}
           
          </div>
    
          <div id="pageSubTitle"  class="eventHalf">
           <h2>Events Listing</h2>
    <p>       This can feature tabs to allow future, recent or archived events<br />
          </div><br />
         {/if}</p>
    
    <p>     <div class="listItemNarrow eventHalf">   <br />
          <div class="eventDate float-left">  <br />
          </p><h2>{entry_date format="%d %m %y %H:%i"}</h2>
    <p>      </div><br />
          <div class="eventTitle float-left"><br />
          </p><h2><a href="http://{url_title_path=/events/}">{title}</a>{related_entries id="event_forum"}, {title}{/related_entries}</h2>
    <p>      </div><br />
          <div class="clear"></div><br />
         </div></p>
    
    <p>    {/if}</p>
    
    <p>    {if segment_2 == url_title}</p>
    
    <p>     <div class="listItemNarrow eventHalf"><br />
          <div class="eventDate float-left">  <br />
          </p><h2>{entry_date format="%d %m %y %H:%i"}</h2>
    <p>      </div><br />
          <div class="eventTitle float-left"><br />
          </p><h2><a href="http://{url_title_path=/events/}">{title}</a></h2>
    <p>      </div><br />
          <div class="clear"></div><br />
         </div><br />
       <br />
         <div class="listItemNarrow eventHalf"></p>
    
    <p>      {embed="embeds/.embed_sharinglinks"}</p>
    
    <p>      {event_introduction}</p>
    
    <p>      {if event_subtitle}<br />
           <div class="bold"><br />
            {event_subtitle}<br />
           </div><br />
          {/if}</p>
    
    <p>      {event_image}<br />
          {event_long_blurb}<br />
          <div class="clear"></div></p>
    
    <p>      {if event_chair}<br />
           <div id="eventChair"><br />
            </p><h2>Chair</h2>
    <p>        {event_chair}<br />
           </div><br />
          {/if}</p>
    
    <p>      {if event_speakers}<br />
           <div id="eventSpeakers"><br />
            </p><h2>Speakers</h2>
    <p>        {event_speakers}<br />
           </div><br />
          {/if}</p>
    
    <p>      {if event_readings}<br />
           <div id="eventReadings"><br />
            </p><h2>Readings</h2>
    <p>        {event_readings}<br />
           </div><br />
          {/if}</p>
    
    <p>      <div class="clear"></div><br />
     <br />
         </div></p>
    
    <p>    {/if} {!-- end if segment_2 == urltitle --}</p>
    
    <p>    {paginate}<br />
         {if "{total_pages}" != 1}<div id="paginationLinks" class="eventHalf">Page {current_page} of {total_pages} pages {pagination_links}</div>{/if}<br />
        {/paginate}  <br />
        <br />
       {/exp:channel:entries}</p>
    
    <p>   {embed="embeds/.footer" color="eventHalf"}</p>
    
    <p>  </div></p>
    
    <p>  <div id="colRight"></p>
    
    <p>   <div id="search"><br />
        {embed="search/.simple_search"}<br />
       </div></p>
    
    <p>   {exp:channel:entries channel="{my_channel}" status="{my_status}" show_future_entries="yes" orderby="event_start_time" disable=”member_data|categories|trackbacks”}</p>
    
    <p>    {if segment_2 == url_title}</p>
    
    <p>     {!-- show the forum logo --}<br />
         {embed="embeds/.embed_RelatedEvents" entryid="{entry_id}"}</p>
    
    <p>     {if event_metadata}<br />
          <div id="eventLocation"><br />
           <div class="boxHeader"><br />
            </p><h2>More Information</h2>
    <p>       </div><br />
           <div class="boxBody"><br />
            {event_metadata}<br />
           </div><br />
          </div><br />
         {/if}</p>
    
    <p>     {if event_location}<br />
          <div id="eventLocation"><br />
           <div class="boxHeader"><br />
            </p><h2>Where</h2>
    <p>       </div><br />
           <div class="boxBody"><br />
            {event_location}<br />
           </div><br />
          </div><br />
         {/if}</p>
    
    <p>     {if event_tickets}<br />
          <div id="eventLocation"><br />
           <div class="boxHeader"><br />
            </p><h2>Tickets</h2>
    <p>       </div><br />
           <div class="boxBody"><br />
            {event_tickets}<br />
           </div><br />
          </div><br />
         {/if}</p>
    
    <p>     {if event_booking}<br />
          <div id="eventLocation"><br />
           <div class="boxHeader"><br />
            </p><h2>Booking</h2>
    <p>       </div><br />
           <div class="boxBody"><br />
            {event_booking}<br />
           </div><br />
          </div><br />
         {/if}</p>
    
    <p>    {if:else}<br />
         {if count == "1"}<br />
          {embed="embeds/.embed_calendar"}<br />
         {/if}<br />
        {/if}</p>
    
    <p>   {/exp:channel:entries}</p>
    
    <p>   {embed="embeds/.socialmedia"}</p>
    
    <p>  </div></p>
    
    <p>  <div class="clear"></div><br />
      <br />
     </div></p>
    
    <p></div></p>
    
    <p>{ioi_html_head_close}

  • #4 / Mar 08, 2012 4:26pm

    Dan Decker

    7338 posts

    Hi Angus K,

    Based on your settings, it may very well be DST related.

    For ExpressionEngine to handle dates and times correctly, the server timezone must be set correctly, including the DST checkbox.

    The other factor is your member account’s localization settings must be correct as well. You can check this by logging in to the Control Panel and clicking the link for “My Account” and then clicking “Localization Settings”. Make sure your timezone and DST options are correct for your location in the UK.

    The reason you are seeing the entry dates change logged out vs. logged in, when you are logged out, the dates are using the server settings. When you are logged in, they are adjusted to your localization settings.

    Make sense?

    Cheers,

  • #5 / Mar 11, 2012 6:51am

    Angus K

    14 posts

    Doesn’t seem to work that way for me I’m afraid.

    When my account localisation settings are the same as the server localisation settings (both at UTC minus 5) and both are set to DST = yes, then the times display correctly when I’m logged in and one hour early when I’m not (i.e. 18:00 instead of 19:00).

    If I change server settings to UTC minus 4 then times display correctly whether logged in or not.

  • #6 / Mar 12, 2012 11:53am

    Angus K

    14 posts

    Update to this, I have set my server settings to CST (I checked and that’s the server time) and set DST = no.

    Now, times display as they are entered in the CMS which is great. The problem is now, through these changes, that times previously entered have all been set two hours earlier.

    If you look at http://www.battleofideas.org.uk/index.php/2011/overview for example, you can see that the first three entries are correct (I changed the date fields) and the rest are two hours earlier than they should be.

    Is there any way of fixing this rather than going into each and every entry and updating the times?? Maybe by getting a list of entry_ids and running an sql update?

  • #7 / Mar 12, 2012 1:24pm

    Shane Eckert

    7174 posts

    Hello Angus K,

    Aside from running a query on the table, I do not see a way to make a mass update like that.

    Just make sure you backup your database first!

    I am glad that you got this working, that is awesome.

    Is there anything else I can help you with?

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases