我需要格式化日期时间到使用PHP的特定日期格式。格式在php中的日期时间
现在日期格式 2014年2月10日9时32分24秒
我需要的格式 2014年2月10日
error is :Parse error: syntax error, unexpected '$ModifiedDate' (T_VARIABLE), expecting ',' or ';' in ................. line
在这里,我试图像这样
<?php
include(config.php);
$sql = "SELECT Id,Title,description,Image,Category,ModifiedDate from News WHERE ISActive=true";
$query = mysql_query($sql);
if(mysql_num_rows($query)>0){
while($test = mysql_fetch_array($query))
{
$Mod = $test['ModifiedDate'];
$ModifiedDate = date_format($Mod, 'yyyy/MM/dd');
echo"<td><font color='black'>"$ModifiedDate"</font></td>";
}
}
else
{
echo "No Records";
}
?>