Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using date_format() and CONVERT_TZ() together

Status
Not open for further replies.

excelsior9

Programmer
Mar 7, 2008
13
GB
Hi guys, I have this code on a page:

$query = "SELECT id,title,author,summary,published,subsection,frontpage,topstory,image1,postdate,date_format(CONVERT_TZ(postdate,'MDT','GMT'),'%d/%m/%y (%T)') AS readable_date FROM content WHERE section='News' ORDER BY postdate DESC";

$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)){


[....]
echo "</td>
<td class=\"normalcell\" style=\"width:140px;\">";
echo $row['readable_date'];
echo "</td>
}



Unfortunately the $row['readable_date']; echo is returning a complete blank space... any ideas why? It was working fine before I added convert_tz()
 
1. Check out faq222-2244 to see how forum etiquette works. You appear to have asked 6 questions, said 0 thank yous, marked 0 answers as helpful and posted 0 replies to anyone else's questions.

2. Are the time zone information tables installed in your mysql database? See for details

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top