Ok so im trying to display a date that i got from a database
Here’s what i can display without any formatting: 2012-11-21 19:00:00
what im trying to display is: 2012-11-21 at 19:00:00
below is the code
$expiryDate = date('Y/m/d', $data[0]->dinExpiry);
$expiryTime = date('H:i', $data[0]->dinExpiry);
And this is the error im getting;

Also the date that it displays is wrong
Thanks in advance for the help
Easy solution
You say that you can display
2012-11-21 19:00:00without any formatting.So if you can display an arbitrary $date as 2012-11-21 19:00:00, why not just substring it:
and show $dateToDisplay as
2012-11-21 at 19:00:00.A little more…
It’s tricky to answer this without knowing the output of $data[0]->dinExpiry. (I’ll assume it gives you a variable called $date).
As @Marc B says, the fact that you’re getting 1970 out of it shows that it’s not a valid timestamp (hint: it’s a string), so it’s evaluated to zero seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
You can convert it to a valid timestamp like so:
Or to match your example: