• Resolved bigimprintwebmaster

    (@bigimprintwebmaster)


    Hi, when reserving a room, the creation date you see under “Pending Reservations” does not correspond to the same timezone of the site (so when I create a reservation at 10AM Chicago time, it displays as created at 3PM). Is there a separate timezone setting for this plugin that I should change? Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The first thing is to make sure that your WordPress is set to local timezone.

    If your host is in a different timezone than your MySQL server, you may need to set that in cpanel or have your host set that.

    IF that doesn’t help I can look at forcing it as a setting.

    Thread Starter bigimprintwebmaster

    (@bigimprintwebmaster)

    Thanks, but my host is in the same timezone, and WordPress is set correctly. I’d think the time would be taken from the WordPress installation (I tried both Chicago and UTC-6), but apparently it’s not. I’d appreciate a way to set it in the plugin. Thanks!

    I’m not sure how savvy you are, but let me know if you can do this:

    On a settings page that isn’t used much, we’re going to add some testing lines.

    If you look at the file:

    wp-content > plugins > book-a-room > templates > content > mainAdmin.php

    It starts with:

    <link href="<?php echo plugins_url(); ?>/book-a-room/css/bookaroom_meetings.css" rel="stylesheet" type="text/css"/>
    <?php
    require( BOOKAROOM_PATH . 'templates/mainSettings/helpTableSetup.php' );
    ?>

    Can you change this to (just adding those preme lines):

    <link href="<?php echo plugins_url(); ?>/book-a-room/css/bookaroom_meetings.css" rel="stylesheet" type="text/css"/>
    <?php
    require( BOOKAROOM_PATH . 'templates/mainSettings/helpTableSetup.php' );
    preme( date( 'm-d-y g:i a', current_time( 'timestamp' ) ) );
    preme( current_time( 'mysql' ) );
    preme( date( 'm-d-y g:i a', time() ) );
    ?>

    Then go into the Content Settings page. You should see some dates at the top. Can you let me know what they are? If you can’t do this, let me know and I’ll look at other ways I can try and debug this.

    Thread Starter bigimprintwebmaster

    (@bigimprintwebmaster)

    Here you go:

    07-02-18 12:44 pm

    2018-07-02 12:44:45

    07-02-18 6:44 pm

    Hope this helps! Thanks!

    There looks to be a difference between the server time zone used by PHP (the 6:44 pm) and your WordPress time zone (12:44 pm).

    But both your WordPress and MySQL time zones show 12:44 pm.

    Is the 12:44 pm your correct local time?

    (As an example, my server is in AZ, but I’m in OH.I get:

    07-02-18 2:50 pm
    2018-07-02 14:50:53
    07-02-18 6:50 pm

    2:50 pm is my correct local time)

    That third line is returning UTC.

    Your WordPress time and MySQL time look good if your local time is 12:44.

    Strange. Are you able to access your database entries? Can you see if the entries are being recoreded properly in the wp_bookaroom_times table? They should be readable in plain text.

    Thread Starter bigimprintwebmaster

    (@bigimprintwebmaster)

    The top two rows show the correct local time (the time I set in Settings->General).

    It looks like the “Created” field takes its time from the 3rd line, however. The TI_CREATED field has that 3rd time in the format: 2018-07-02 17:58:56

    Let me know if there’s any other info I can provide.

    Thanks.

    TI_CREATED is set by the server to log in real time when it was created.

    The times it is pulling are coming from ti_startTime and ti_endTime. Are those correct?

    Thread Starter bigimprintwebmaster

    (@bigimprintwebmaster)

    I don’t have an issue with the reservation start time and end time of the reservation, though. I have an issue with the creation time – which is UTC. My client wants it to be the actual time when the person made the reservation.

    I have a line I wrote up that you can add to fix this, but it’s still not accepting DST. Working on it.

    At this point I may make some changes that directly enter the date in local format for the creation date.

    This would avoid all of the timezone problems.

    I’ll play around on my test site and see how this works.

    Thread Starter bigimprintwebmaster

    (@bigimprintwebmaster)

    Thanks! I’ll be waiting for developments.

    I just put up a new version. New meeting requests will save their created time with the local time and should present correctly. Unfortunately this won’t affect older items.

    Can you let me know if this looks better?

    Thread Starter bigimprintwebmaster

    (@bigimprintwebmaster)

    This looks perfect. Thank you for all your help! Much appreciated!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Pending Reservations creation timezone different than site timezone’ is closed to new replies.