private function formatDate(\DateTime $datetime = null, $format = 'Y_m_d')
    {
        if (null == $datetime) {
            $datetime = new \DateTime('now');
        }

        return $datetime->format($format);
    }
private function formatDate(\DateTime $datetime = null, $format = 'Y_m_d')
    {
        if (null == $datetime) {
            $datetime = new \DateTime('now');
        }

        return $datetime->format($format);
    }
private function formatDate ( \ DateTime $ datetime = null , $ format = 'Y_m_d' ) { if ( null == $ datetime ) { $ datetime = new \ DateTime ( 'now' ) ; } return $ datetime -> format ( $ format ) ; }
format a date.

@param \DateTime $datetime
@param string    $format

@return string
format a date .