嗨,我在MySQL中存储了时间戳,并且在更新CURRENT_TIMESTAMP上有这个属性,当我回显它时,给我日期和时间,我怎么能只显示日期,而不需要时间。这一次显示数据被包含在数据库中的日期和时间--我有以下代码
if (php_sapi_name() == 'apache') {
// if our web server is apache
// we get check HTTP
// If-Modified-Since header
// and do not send image
// if there is a cached version
$ar = apache_request_headers();
if (isset($ar['If-Modified-Since']) && // If-Modified-Since should exists
($ar['If-Modified-Since'] != '') && // not empty
(strtotime($ar['If-Modified-Since']) >= $image_time)) // and grater than
$send_304 = true; // image_time
}
if ($send_304)
{
// Sending 304 response to browser
// "Browser, your cached version of image is OK
// we're not sending anything new to you"
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $ts).' GMT', true, 304);
exit(); // bye-bye
}
// outputing Last-Modified header
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $image_time).' GMT',
true, 200);
// Set expiration time +1 year
// We do not have any photo re-uploading
// so, browser may cache this photo for quite a long time
header('Expires: '.gmdate('D, d M Y H:i:s', $image_time + 86400*365).' GMT',
true, 200);我试着删除H:i:s,但是这并没有改变到输出,我如何才能改变它呢?
发布于 2014-01-29 10:58:05
删除H:i:s将改变输出,我怀疑您更改了错误的内容。
d/m/Y H:i:s将输出01/01/2014 00:00:00
d/m/Y将输出01/01/2014
发布于 2014-01-29 11:00:11
删除H:i:s函数中的参数.gmdate
https://stackoverflow.com/questions/21428857
复制相似问题