How to add published date in product [closed]

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