The simplest solution is to extract it from the database in the desired format. If using MySQL, use the DATE_FORMAT() to format it, e.g.:
SELECT *, DATE_FORMAT(timestamp_field, '%Y-%m-%d') AS date_ymd FROM table_name
If that is not practical for some reason, then if, in fact, the value you are getting from the database is a UNIX timestamp integer, then as I suggested above, you just supply that value as the second parameter to date():
echo date('Y-m-d', $timestamp_value_from_db);