Formating the display of a post’s date, outside the Loop

I’m using something like this:

date('F, Y', strtotime($data[0]->post_date));

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