Support » Plugin: Date and Time Picker Field » Time displayed one hour early

  • Resolved chocaccro

    (@chocaccro)


    Hello,

    The time dispayed on frontend is one hour early.
    For example I have an event beginning at 8:00 and the time displayed is 9:00.

    I use the Time Picker
    Save as timestamp Yes
    Get field as timestamp No

    Here is the code :

    if(get_field('heure-debut')) {
          echo '<li>' . get_field('heure-debut') . '</li>';
    }

    Thks for your help.

    https://wordpress.org/plugins/acf-field-date-time-picker/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi chocaccro,
    I had the same problem and fixed it by using a different time format.
    At the moment I’m using HH:mm.
    Not quiet sure if this will fix your problem, but I thought maybe it will solve your problem too.

    Thread Starter chocaccro

    (@chocaccro)

    Hi,

    I tried to change the time format but it doesn’t work.

    Settings :
    Save as timestamp? Yes
    Get field as timestamp? No

    Code :

    if(get_field('heure-debut')) {
    echo ' à ' . get_field('heure-debut');
    }

    Thks for your help

    Thread Starter chocaccro

    (@chocaccro)

    Hi,

    I fixed it.

    Settings :
    Save as timestamp? Yes
    Get field as timestamp? Yes

    Code :

    $format = "G:i";
    $timestamp = get_field($field_name);
    echo date_i18n( $format, $timestamp, true );

    See these links for more details :
    Date and Time Picker field for Advanced Custom Fields

    Function Reference/date i18n

    Thread Starter chocaccro

    (@chocaccro)

    Sorry, I forgot to mark this topic as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Time displayed one hour early’ is closed to new replies.