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.

EE Calendar "Today" date doesn't precisely match current_time

October 10, 2012 1:20pm

Subscribe [2]
  • #1 / Oct 10, 2012 1:20pm

    Susan

    81 posts

    EE version v2.5.2 - Build Date: 20120606 [i.e., core calendar code uses the $d = gmdate construction. I just checked.]
    Server Envrionment: MAMP (MacPro, MacOS X preferences: Pacific Time Zone, Daylight Savings Time active)

    Mamp phpinfo settings for time zone:

    date/time support                      enabled
    "Olson" Timezone Database Version      2009.13
    Timezone Database                      internal
    Default timezone                       America/Los_Angeles
    

    EE settings:
    Server Time Zone:
    UTC -8:00 Pacific Standard Time, Clipperton Island
    DST: YES

    User (SuperAdmin) settings, localization:
    UTC -8:00 Pacific Standard Time, Clipperton Island
    DST: YES.

    MAMP’s php.ini has nothing for setting timezone nor DST. But, as you can see from the phpinfo settings, it at least thinks I’m in Pacific Time.

    Last night between 11:58pm - 12:20am or so local time, I encountered an issue where the calendar doesn’t change at midnight local time to reflect the current day.

    Symptoms

    Hey! It’s nearly midnight! I want to see how current day styling applies once the day turns over, because there’s an entry in my October 10th day of this event calendar. I’ll wait a minute until midnight, refresh the page and see what works.

    What? It didn’t work.

    On the calendar page, the “today” was still set to October 9.

    /Symptoms

    What follows is what I quickly checked out. Alas, I didn’t stay up until 1 to see if it changed. Sleep, you know.  This morning at 9am, the calendar has re-synced with the current day. I do not know at what hour between midnight and 9 am it did so.

    I checked to see what EE thinks that current time is by placing this code in template elsewhere.

    Hello, World. The time is currently {current_time format="%D %F %j, %Y %g:%i %a %T"}

    Page said: The time is currently Wed October 10, 2012 12:14 am PDT.

    (Very similar to what was described in here and here. 2nd link had the mention of the change from $date to $gmdate, which I double checked this morning in EE core))

    Before too long I’m going to put the site on a staging server, so I will see if this issue propagages to a different server environment.  I’m not overly concerned that this is a MAMP problem (maybe MAMP php settings don’t account for DST? Had I stayed up until 1 am, I could have found out whether the day changed then or not.)

    But for a site that relies heavily on a calendar, I’m on high alert.

    Calendar template code:

    {exp:channel:calendar switch="calendarToday|calendarCell" channel="events|satellite" show_expired="yes" show_future_entries="yes"}
      <!-- border="0" cellpadding="6" cellspacing="1" summary="My Calendar" width="90%" WAS part of original EE supplied code -->
      <table class="table table-bordered calendarBG">
       <caption></caption>
       <tr class="calendarHeader">
        <th>
         <div class="calendarMonthLinks">
          <a href="http://{previous_path=events/calendar}"><i class="icon-arrow-left icon-large mediumtop"></i></a>
         </div>
        </th>
        <th colspan="5" class="calendarMonthHeading"><h2 class="center">{date format="%F %Y"}<h2></th>
        <th>
         <div class="calendarMonthLinks">
          <a href="http://{next_path=events/calendar}class=calendarMonthLinks"><i class="icon-arrow-right icon-large mediumtop"></i></a>
         </div>
        </th>
       </tr>
       <tr>
        {calendar_heading}
         <td class="calendarDayHeading">{lang:weekday_long}</td>
        {/calendar_heading}
       </tr>
       {calendar_rows}
        {row_start}<tr>{/row_start}
        {if entries}
         <td class="{switch}">
          <a href="http://{day_path=events/index}"><div class="day-number">{day_number}</div></a>
          {entries}<div class="meeting cell-{embed='embeds/events-cat-css' the_id='{entry_id}'}">
           <a href="http://{title_permalink=events/index}">_       <small>{entry_date format="%g:%i %a"}</small>__       {exp:word_limit total="6"}_        {title}_       {/exp:word_limit}_       </a></div>
          {/entries}
         </td>
        {/if}
        {if not_entries}
         <td class='{switch}' align='center'><div class="day-number">{day_number}</div></td>
        {/if}
        {if blank}
         <td class='calendarBlank'>{day_number}</td>
        {/if}
        {row_end}</tr>{/row_end}
       {/calendar_rows}
      </table>  
     {/exp:channel:calendar}

    Got any ideas? How many times am I going to have to stay awake till 1am or more to see what the issue is? Should I take a nap today?

  • #2 / Oct 11, 2012 4:09am

    Susan

    81 posts

    okay, I happened to be up until 1:00 am and can report the following MEH news:

    current_time says: “Hello, World. The time is currently Thu October 11, 2012 1:07 am PDT.”

    The calendar page thinks that “today” is Wednesday October 10th.

    (I am NOT staying up to pinpoint the time on this, tho.)

  • #3 / Oct 12, 2012 1:01pm

    Shane Eckert

    7174 posts

    Hello Susan,

    It looks like you have everything set as needed, as far as I can tell. I do not have a whole lot of experience with MAMP. When you do get this on a staging server I would love to know if it persists and if it does, I would really like to get in and take a look.

    You might also think about upgrading to 2.5.3 as there were over 100 bug fixes.

    Do you have an ETA on moving to a staging server?

    Thank you,

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

ExpressionEngine News!

#eecms, #events, #releases