define('TS_MW',1);
/** Standard database timestamp (yyyy-mm-dd hh:mm:ss) */
define('TS_DB',2);
+/** For HTTP and e-mail headers -- output only */
+define('TS_RFC2822', 3 );
/**
* @todo document
switch($outputtype) {
case TS_UNIX:
return $uts;
- break;
case TS_MW:
return gmdate( 'YmdHis', $uts );
- break;
case TS_DB:
return gmdate( 'Y-m-d H:i:s', $uts );
- break;
+ case TS_RFC2822:
+ return gmdate( "D, j M Y H:i:s", $uts ) . ' GMT';
default:
return;
}
return;
}
- $lastmod = gmdate( 'D, j M Y H:i:s', wfTimestamp(TS_UNIX, max( $timestamp, $wgUser->mTouched ) ) ) . ' GMT';
+ $lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->mTouched ) );
if( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
# IE sends sizes after the date like this:
if( !$wgDebugRedirects ) {
header("HTTP/1.1 {$this->mRedirectCode} Moved Permanently");
}
- $this->mLastModified = gmdate( 'D, j M Y H:i:s' ) . ' GMT';
+ $this->mLastModified = wfTimestamp( TS_RFC2822 );
}
$this->sendCacheControl();