npsari Posted April 16, 2007 Share Posted April 16, 2007 I have a row called Date in the databse which is saved as 0000-00-00 When I try to echo it, it shows like that 2007-04-16 Maybe because I use this normal code: echo $row['Date']; How can I display it like that: 16-04-2007 Link to comment https://forums.phpfreaks.com/topic/47306-solved-displaying-the-date-in-a-different-format/ Share on other sites More sharing options...
per1os Posted April 16, 2007 Share Posted April 16, 2007 $time = strtotime($row['Date']); echo date('d-m-Y', $time); Something like that should work. Link to comment https://forums.phpfreaks.com/topic/47306-solved-displaying-the-date-in-a-different-format/#findComment-230773 Share on other sites More sharing options...
npsari Posted April 16, 2007 Author Share Posted April 16, 2007 Done Thanks pal You are a ginius Cus this was a simple and effecetive solution Link to comment https://forums.phpfreaks.com/topic/47306-solved-displaying-the-date-in-a-different-format/#findComment-230777 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.