public static function getPHPFormat(EntityInterface $field)
    {
        $settings = $field->metadata->settings;
        $format = empty($settings['format']) ? 'yy-mm-dd' : $settings['format'];
        if ($settings['timepicker']) {
            $format .= ' ';
            if (empty($settings['time_format'])) {
                $format .= 'H:mm';
                $format .= empty($settings['time_seconds']) ?: ':ss';
            } else {
                $format .= $settings['time_format'];
            }
        }

        return static::normalizeFormat($format);
    }
public static function getPHPFormat(EntityInterface $field)
    {
        $settings = $field->metadata->settings;
        $format = empty($settings['format']) ? 'yy-mm-dd' : $settings['format'];
        if ($settings['timepicker']) {
            $format .= ' ';
            if (empty($settings['time_format'])) {
                $format .= 'H:mm';
                $format .= empty($settings['time_seconds']) ?: ':ss';
            } else {
                $format .= $settings['time_format'];
            }
        }

        return static::normalizeFormat($format);
    }
public static function getPHPFormat ( EntityInterface $ field ) { $ settings = $ field -> metadata -> settings ; $ format = empty ( $ settings [ 'format' ] ) ? 'yy-mm-dd' : $ settings [ 'format' ] ; if ( $ settings [ 'timepicker' ] ) { $ format .= ' ' ; if ( empty ( $ settings [ 'time_format' ] ) ) { $ format .= 'H:mm' ; $ format .= empty ( $ settings [ 'time_seconds' ] ) ? : ':ss' ; } else { $ format .= $ settings [ 'time_format' ] ; } } return static :: normalizeFormat ( $ format ) ; }
Given a DateField instance, gets its PHP's date-format.

@param \Cake\Datasource\EntityInterface $field DateField instance
@return string PHP date-format for later use with date() function
Given a DateField instance gets its PHP s date - format .