Support

Account

Home Forums ACF PRO set default date and time on datetimepicker field

Helping

set default date and time on datetimepicker field

    • XXVII

    • December 16, 2018 at 5:12 am

    Hello,
    I’m trying to set the default date and time value on a datetimepicker field.

    I succedeed at setting the default date but the time displayed is always the current time

    
    function default_start_date($field) {
    	$field['default_value'] = date('d/m/Y H:i:s', strtotime('today 00:00:00'));
    	return $field;
    }
    add_filter('acf/load_field/name=start_date', 'default_start_date');
    

    Expected result: 15/12/2018 00:00
    Result: 15/12/2018 18:50

    • XXVII

    • January 7, 2020 at 10:32 pm

    Hi, any clues?

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.