How to add published date in product [closed]

$post_id = 12;
echo get_the_date( 'Y-m-d',$post_id);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)