src/Utils/CommonUtil.php
public static function dateSQL($date, $format = 'd-m-Y')
    {
        if (empty($date)) {
            return null;
        }

        $obj = DateTime::createFromFormat('Y-m-d H:i:s', $date);
        if (empty($obj)) {
            return null;
        }

        return $obj->format($format);
    }
public static function dateSQL($date, $format = 'd-m-Y')
    {
        if (empty($date)) {
            return null;
        }

        $obj = DateTime::createFromFormat('Y-m-d H:i:s', $date);
        if (empty($obj)) {
            return null;
        }

        return $obj->format($format);
    }
public static function dateSQL ( $ date , $ format = 'd-m-Y' ) { if ( empty ( $ date ) ) { return null ; } $ obj = DateTime :: createFromFormat ( 'Y-m-d H:i:s' , $ date ) ; if ( empty ( $ obj ) ) { return null ; } return $ obj -> format ( $ format ) ; }
SQL timestamp to date format
@param  string $date
@param  string $format
@return string
SQL timestamp to date format