What am I doing wrong?
I've stored the date in american format (yyyy-mm-dd) and want to output it in european format (dd-mm-yyy).

This is my code.

//ZENDING
$result = mysql_query("select ID, Bestemming, Afkorting, Datum FROM Zendingen WHERE ID ='" . $znding . "' ORDER BY ID, Bestemming ASC") OR DIE ( mysql_error() ); 

while($row = mysql_fetch_array($result))
  {
  $datumzending = $row['Datum'];
  echo $row['Bestemming'];
  echo date("Y-m-d",$datumzending); 
  echo "<br />";
  echo "<br />";
  }

Thanks in advance!

echo date("d-m-Y", $datumzending);

the problem is that it always shows up as 1-1-1970, why is that?

Then it was not inserted correctly (NULL). It is a date column ?

Then it was not inserted correctly (NULL). It is a date column ?

Yes it is...
Weird thing :( any info you need?

Can you give an example of your insert query ?

Can you give an example of your insert query ?

The input should be fine. It is a custom made table like thing which i handed out to someone else.
it inputs the data fine.

BTW: Solved

It called for the wrong attribute ;) Sorry for wasting your time!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.