Support

Account

Home Forums Bug Reports [important] date picker date is saved minus 1 day

Solved

[important] date picker date is saved minus 1 day

  • Version: ACF 5.8.9

    Case:
    Repeater field with start and end date.
    This is the setting
    settings

    Problem:
    saved dates jump one day back.
    example: select friday april 24 and save the post.
    output is thursday 23

    This is a big issue!

  • It gets even more weird, look at the month of the date picker and the corresponding source code

    woah

    functions.php only related time stuff is the following code

    date_default_timezone_set('Europe/Berlin'); // Lokalzeit
    setlocale(LC_TIME, array('de_DE.UTF-8', 'de.UTF-8'));
  • searched the forums and removed “date_default_timezone_set” from theme.
    checked the rest of the setup. seems to fix the problem.

  • Hello,
    Same problem. Removed “date_default_timezone_set” but not fixed for me.

    Edit : The server is not on ‘UTC’ and I can’t modify that.

  • I solved this as well by removing

    date_default_timezone_set(‘Europe/Berlin’);

    from function.php.

    However this seems still weird to me and should be fixed in future releases…

  • I exactly have the same problem this morning, I removed ( that I added this morning )
    date_default_timezone_set('Europe/Paris');

    and i works again.

    Now my problem comes from my mamp which gives me the wrong time/clock ! 🙂
    ++nico

  • Stumbled upon this report after a couple of hours struggling, can confirm the same issue with WP 6.01 / ACF 5.12.3

    I’m using ACF with a calendar PHP script and I need to use
    date_default_timezone_set(‘Europe/Rome’);
    in one of my functions.

    This results literally in a datepicker value that, when retrieved from that function
    get_field (‘my_date’, $post_id); //format Y-m-d
    // * * * output: 2022-07-06`

    while if edited in the original post field or even in the database record is:
    // * * * output: 2022-07-07

    EDIT: as per this other thread, it looks like a WordPress core issue

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘[important] date picker date is saved minus 1 day’ is closed to new replies.