Support

Account

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

Helping

set default date and time on datetimepicker field

  • 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

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

You must be logged in to reply to this topic.