$timestamp = wfTimestamp( TS_MW, $timestamp );
$lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->getTouched(), $wgCacheEpoch ) );
$timestamp = wfTimestamp( TS_MW, $timestamp );
$lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->getTouched(), $wgCacheEpoch ) );