Orion
Orion

Reputation: 393

unable to show date with correct time

I'm setting in another section that it saves with curdate(); the date into a DB after that I want to list the value in a table with its time but when I try to make it this way:

echo "<td style='width: 15%;'>". date("d.m.Y H:i:s", strtotime($row['Erstelldatum'])) . '</td>';

I'm getting this: enter image description here

The format is right (German) but the time is not correct. What is wrong here? Is the DB format wrong? enter image description here

Upvotes: 0

Views: 76

Answers (1)

Mihai Matei
Mihai Matei

Reputation: 24276

The field type in database must be DATETIME. Your current type is DATE.

Upvotes: 3

Related Questions