Index: typo3/alt_shortcut.php
===================================================================
--- typo3/alt_shortcut.php	(revision 5641)
+++ typo3/alt_shortcut.php	(working copy)
@@ -194,7 +194,7 @@
 				'module_name' => $this->modName.'|'.$this->M_modName,
 				'url' => $this->URL,
 				'description' => $description,
-				'sorting' => time(),
+				'sorting' => $GLOBALS['SIM_EXEC_TIME'],
 			);
 			$GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_be_shortcuts', $fields_values);
 		}
Index: typo3/sysext/rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php
===================================================================
--- typo3/sysext/rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php	(revision 5641)
+++ typo3/sysext/rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php	(working copy)
@@ -66,7 +66,7 @@
 
 			// Remove expired keys (more than 30 minutes old)
 			$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
-						'crdate<' . (time() - 30*60));
+						'crdate<' . ($GLOBALS['SIM_EXEC_TIME'] - 30*60));
 
 			// Get our value
 			list($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('key_value',
@@ -112,7 +112,7 @@
 			//
 			// Notice: we may not use TCEmain below to insert key part into the
 			// table because TCEmain requires a valid BE user!
-			$time = time();
+			$time = $GLOBALS['SIM_EXEC_TIME'];
 			$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_rsaauth_keys', array(
 				'pid' => 0,
 				'crdate' => $time,
@@ -126,7 +126,7 @@
 
 		// Remove expired keys (more than 30 minutes old)
 		$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
-					'crdate<' . (time() - 30*60));
+					'crdate<' . ($GLOBALS['SIM_EXEC_TIME'] - 30*60));
 	}
 }
 
Index: typo3/sysext/lowlevel/clmods/class.syslog.php
===================================================================
--- typo3/sysext/lowlevel/clmods/class.syslog.php	(revision 5641)
+++ typo3/sysext/lowlevel/clmods/class.syslog.php	(working copy)
@@ -94,7 +94,7 @@
 		$rows = $TYPO3_DB->exec_SELECTgetRows(
 				'*',
 				'sys_log',
-				'tstamp>'.(time()-25*3600)
+				'tstamp>'.($GLOBALS['SIM_EXEC_TIME']-25*3600)
 			);
 		foreach($rows as $r)	{
 			$l = unserialize($r['log_data']);
Index: typo3/sysext/cms/layout/class.tx_cms_layout.php
===================================================================
--- typo3/sysext/cms/layout/class.tx_cms_layout.php	(revision 5641)
+++ typo3/sysext/cms/layout/class.tx_cms_layout.php	(working copy)
@@ -2164,7 +2164,7 @@
 		$theData['subject'] = t3lib_div::fixed_lgd_cs(htmlspecialchars($row['subject']),25).'&nbsp; &nbsp;';
 		$theData['author'] = t3lib_div::fixed_lgd_cs(htmlspecialchars($row['author']),15).'&nbsp; &nbsp;';
 		$theData['date'] = t3lib_div::fixed_lgd_cs(t3lib_BEfunc::datetime($row['crdate']),20).'&nbsp; &nbsp;';
-		$theData['age'] = t3lib_BEfunc::calcAge(time()-$row['crdate'], $this->agePrefixes).'&nbsp; &nbsp;';
+		$theData['age'] = t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$row['crdate'], $this->agePrefixes).'&nbsp; &nbsp;';
 		if ($re)	{
 			$theData['replys'] = $re;
 		}
@@ -2284,8 +2284,8 @@
 		global $TCA;
 		if (
 			($TCA[$table]['ctrl']['enablecolumns']['disabled'] && $row[$TCA[$table]['ctrl']['enablecolumns']['disabled']]) ||
-			($TCA[$table]['ctrl']['enablecolumns']['starttime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['starttime']]>time() ) ||
-			($TCA[$table]['ctrl']['enablecolumns']['endtime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']]<time())
+			($TCA[$table]['ctrl']['enablecolumns']['starttime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['starttime']]>$GLOBALS['SIM_EXEC_TIME'] ) ||
+			($TCA[$table]['ctrl']['enablecolumns']['endtime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']]<$GLOBALS['SIM_EXEC_TIME'])
 		)	return true;
 	}
 
@@ -2460,14 +2460,14 @@
 		}
 
 			// Created:
-		$lines[]=array($LANG->getLL('pI_crDate').':', t3lib_BEfunc::datetime($rec['crdate']).' ('.t3lib_BEfunc::calcAge(time()-$rec['crdate'],$this->agePrefixes).')');
+		$lines[]=array($LANG->getLL('pI_crDate').':', t3lib_BEfunc::datetime($rec['crdate']).' ('.t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$rec['crdate'],$this->agePrefixes).')');
 
 			// Last change:
-		$lines[]=array($LANG->getLL('pI_lastChange').':', t3lib_BEfunc::datetime($rec['tstamp']).' ('.t3lib_BEfunc::calcAge(time()-$rec['tstamp'],$this->agePrefixes).')');
+		$lines[]=array($LANG->getLL('pI_lastChange').':', t3lib_BEfunc::datetime($rec['tstamp']).' ('.t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$rec['tstamp'],$this->agePrefixes).')');
 
 			// Last change of content:
 		if ($rec['SYS_LASTCHANGED'])	{
-			$lines[]=array($LANG->getLL('pI_lastChangeContent').':', t3lib_BEfunc::datetime($rec['SYS_LASTCHANGED']).' ('.t3lib_BEfunc::calcAge(time()-$rec['SYS_LASTCHANGED'],$this->agePrefixes).')');
+			$lines[]=array($LANG->getLL('pI_lastChangeContent').':', t3lib_BEfunc::datetime($rec['SYS_LASTCHANGED']).' ('.t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$rec['SYS_LASTCHANGED'],$this->agePrefixes).')');
 		}
 
 			// Spacer:
Index: typo3/sysext/cms/layout/db_layout.php
===================================================================
--- typo3/sysext/cms/layout/db_layout.php	(revision 5641)
+++ typo3/sysext/cms/layout/db_layout.php	(working copy)
@@ -1226,7 +1226,7 @@
 				if($this->undoButton) {
 						// Undo button
 					$buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'' . $BACK_PATH . 'show_rechis.php?element=' . rawurlencode($this->eRParts[0] . ':' . $this->eRParts[1]) . '&revert=ALL_FIELDS&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;') . '">' .
-						'<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/undo.gif', 'width="21" height="16"') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($LANG->getLL('undoLastChange'), t3lib_BEfunc::calcAge(time() - $this->undoButtonR['tstamp'], $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
+						'<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/undo.gif', 'width="21" height="16"') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($LANG->getLL('undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME'] - $this->undoButtonR['tstamp'], $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
 						'</a>';
 
 						// History button
Index: typo3/sysext/cms/tslib/class.tslib_fe.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_fe.php	(revision 5641)
+++ typo3/sysext/cms/tslib/class.tslib_fe.php	(working copy)
@@ -1657,7 +1657,7 @@
 				'*',
 				'sys_preview',
 				'keyword='.$GLOBALS['TYPO3_DB']->fullQuoteStr($inputCode, 'sys_preview').
-					' AND endtime>'.time()
+					' AND endtime>'.$GLOBALS['SIM_EXEC_TIME']
 			);
 
 				// Get: Backend login status, Frontend login status
@@ -4095,7 +4095,7 @@
 	 * @access private
 	 */
 	function updateMD5paramsRecord($hash)	{
-		$GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_md5params', 'md5hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_md5params'), array('tstamp' => time()));
+		$GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_md5params', 'md5hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_md5params'), array('tstamp' => $GLOBALS['SIM_EXEC_TIME']));
 	}
 
 	/**
Index: typo3/sysext/cms/tslib/class.tslib_fetce.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_fetce.php	(revision 5641)
+++ typo3/sysext/cms/tslib/class.tslib_fetce.php	(working copy)
@@ -233,8 +233,8 @@
 	 */
 	function execNEWinsert($table, $dataArr)	{
 		$extraList=$this->extraList;
-		if ($GLOBALS['TCA'][$table]['ctrl']['tstamp'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['tstamp']; $dataArr[$field]=time(); $extraList.=','.$field;}
-		if ($GLOBALS['TCA'][$table]['ctrl']['crdate'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['crdate']; $dataArr[$field]=time(); $extraList.=','.$field;}
+		if ($GLOBALS['TCA'][$table]['ctrl']['tstamp'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['tstamp']; $dataArr[$field]=$GLOBALS['SIM_EXEC_TIME']; $extraList.=','.$field;}
+		if ($GLOBALS['TCA'][$table]['ctrl']['crdate'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['crdate']; $dataArr[$field]=$GLOBALS['SIM_EXEC_TIME']; $extraList.=','.$field;}
 		if ($GLOBALS['TCA'][$table]['ctrl']['cruser_id'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['cruser_id']; $dataArr[$field]=0; $extraList.=','.$field;}
 
 		unset($dataArr['uid']);	// uid can never be set
Index: typo3/sysext/cms/tslib/hooks/class.tx_cms_treelistcacheupdate.php
===================================================================
--- typo3/sysext/cms/tslib/hooks/class.tx_cms_treelistcacheupdate.php	(revision 5641)
+++ typo3/sysext/cms/tslib/hooks/class.tx_cms_treelistcacheupdate.php	(working copy)
@@ -370,7 +370,7 @@
 	protected function removeExpiredCacheEntries() {
 		$GLOBALS['TYPO3_DB']->exec_DELETEquery(
 			'cache_treelist',
-			'expires <= ' . time()
+			'expires <= ' . $GLOBALS['SIM_EXEC_TIME']
 		);
 	}
 
Index: typo3/sysext/cms/tslib/class.tslib_content.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_content.php	(revision 5641)
+++ typo3/sysext/cms/tslib/class.tslib_content.php	(working copy)
@@ -3399,7 +3399,7 @@
 						$content = $GLOBALS['TSFE']->csConv($content,$tmp_charset);
 					}
 				}
-				if ($conf['age']){$content=$this->calcAge(time()-$content,$conf['age']);}
+				if ($conf['age']){$content=$this->calcAge($GLOBALS['SIM_EXEC_TIME']-$content,$conf['age']);}
 
 				if ($conf['case']){$content=$this->HTMLcaseshift($content, $conf['case']);}
 				if ($conf['bytes']){$content=t3lib_div::formatSize($content, $conf['bytes.']['labels']);}
@@ -5092,7 +5092,7 @@
 					break;
 					case 'date':
 						if (!$key) {$key = 'd/m Y';}
-						$retVal = date($key, time());
+						$retVal = date($key, $GLOBALS['SIM_EXEC_TIME']);
 					break;
 					case 'page':
 						$retVal = $GLOBALS['TSFE']->page[$key];
@@ -6597,7 +6597,7 @@
 			}
 
 			if ($GLOBALS['TCA'][$table]['ctrl']['tstamp'])	{
-				$updateFields[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = time();
+				$updateFields[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['SIM_EXEC_TIME'];
 			}
 
 			if (count($updateFields))	{
@@ -6626,8 +6626,8 @@
 	 */
 	function DBgetInsert($table, $pid, $dataArr, $fieldList, $doExec=FALSE)	{
 		$extraList='pid';
-		if ($GLOBALS['TCA'][$table]['ctrl']['tstamp'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['tstamp']; $dataArr[$field]=time(); $extraList.=','.$field;}
-		if ($GLOBALS['TCA'][$table]['ctrl']['crdate'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['crdate']; $dataArr[$field]=time(); $extraList.=','.$field;}
+		if ($GLOBALS['TCA'][$table]['ctrl']['tstamp'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['tstamp']; $dataArr[$field]=$GLOBALS['SIM_EXEC_TIME']; $extraList.=','.$field;}
+		if ($GLOBALS['TCA'][$table]['ctrl']['crdate'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['crdate']; $dataArr[$field]=$GLOBALS['SIM_EXEC_TIME']; $extraList.=','.$field;}
 		if ($GLOBALS['TCA'][$table]['ctrl']['cruser_id'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['cruser_id']; $dataArr[$field]=0; $extraList.=','.$field;}
 		if ($GLOBALS['TCA'][$table]['ctrl']['fe_cruser_id'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['fe_cruser_id']; $dataArr[$field]=intval($GLOBALS['TSFE']->fe_user->user['uid']); $extraList.=','.$field;}
 		if ($GLOBALS['TCA'][$table]['ctrl']['fe_crgroup_id'])	{$field=$GLOBALS['TCA'][$table]['ctrl']['fe_crgroup_id']; list($dataArr[$field])=explode(',',$GLOBALS['TSFE']->fe_user->user['usergroup']); $dataArr[$field]=intval($dataArr[$field]); $extraList.=','.$field;}
@@ -6804,7 +6804,7 @@
 				$cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
 					'treelist',
 					'cache_treelist',
-					'md5hash = \'' . $requestHash . '\' AND ( expires > ' . time() . ' OR expires = 0 )'
+					'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['SIM_EXEC_TIME'] . ' OR expires = 0 )'
 				);
 
 				if (!empty($cacheEntry[0]['treelist'])) {
@@ -6931,7 +6931,7 @@
 					'md5hash'  => $requestHash,
 					'pid'      => $id,
 					'treelist' => $theList,
-					'tstamp'   => time()
+					'tstamp'   => $GLOBALS['SIM_EXEC_TIME']
 				)
 			);
 		}
@@ -7408,8 +7408,8 @@
 		if (
 			($TCA[$table]['ctrl']['enablecolumns']['disabled'] && $row[$TCA[$table]['ctrl']['enablecolumns']['disabled']]) ||
 			($TCA[$table]['ctrl']['enablecolumns']['fe_group'] && $GLOBALS['TSFE']->simUserGroup && $row[$TCA[$table]['ctrl']['enablecolumns']['fe_group']]==$GLOBALS['TSFE']->simUserGroup) ||
-			($TCA[$table]['ctrl']['enablecolumns']['starttime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['starttime']]>time() ) ||
-			($TCA[$table]['ctrl']['enablecolumns']['endtime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']]<time())
+			($TCA[$table]['ctrl']['enablecolumns']['starttime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['starttime']]>$GLOBALS['SIM_EXEC_TIME'] ) ||
+			($TCA[$table]['ctrl']['enablecolumns']['endtime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']]<$GLOBALS['SIM_EXEC_TIME'])
 		)	return true;
 	}
 }
Index: typo3/sysext/cms/tslib/class.tslib_feuserauth.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_feuserauth.php	(revision 5641)
+++ typo3/sysext/cms/tslib/class.tslib_feuserauth.php	(working copy)
@@ -370,7 +370,7 @@
 		}
 			// delete old data:
 		if ((rand()%100) <= 1) {		// a possibility of 1 % for garbage collection.
-			$GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < '.intval(time()-3600*24));		// all data older than 24 hours are deleted.
+			$GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < '.intval($GLOBALS['SIM_EXEC_TIME']-3600*24));		// all data older than 24 hours are deleted.
 		}
 	}
 
@@ -392,7 +392,7 @@
 				$insertFields = array (
 					'hash' => $this->id,
 					'content' => serialize($this->sesData),
-					'tstamp' => time()
+					'tstamp' => $GLOBALS['SIM_EXEC_TIME']
 				);
 				$this->removeSessionData();
 				$GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_session_data', $insertFields);
Index: typo3/sysext/cms/web_info/class.tx_cms_webinfo_lang.php
===================================================================
--- typo3/sysext/cms/web_info/class.tx_cms_webinfo_lang.php	(revision 5641)
+++ typo3/sysext/cms/web_info/class.tx_cms_webinfo_lang.php	(working copy)
@@ -386,8 +386,8 @@
 		if (is_array($row))	{
 			$row['_COUNT'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
 			$row['_HIDDEN'] = $row['hidden'] ||
-							(intval($row['endtime']) > 0 && intval($row['endtime']) < time()) ||
-							(time() < intval($row['starttime']));
+							(intval($row['endtime']) > 0 && intval($row['endtime']) < $GLOBALS['SIM_EXEC_TIME']) ||
+							($GLOBALS['SIM_EXEC_TIME'] < intval($row['starttime']));
 		}
 
 		return $row;
Index: typo3/sysext/impexp/class.tx_impexp.php
===================================================================
--- typo3/sysext/impexp/class.tx_impexp.php	(revision 5641)
+++ typo3/sysext/impexp/class.tx_impexp.php	(working copy)
@@ -336,7 +336,7 @@
 			'packager_email' => $packager_email,
 			'TYPO3_version' => TYPO3_version,
 #			'loaded_extensions' => $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'],
-			'created' => strftime('%A %e. %B %Y', time())
+			'created' => strftime('%A %e. %B %Y', $GLOBALS['SIM_EXEC_TIME'])
 		);
 	}
 
@@ -833,7 +833,7 @@
 						// This is only done with files grabbed by a softreference parser since it is deemed improbable that hard-referenced files should undergo this treatment.
 					$html_fI = pathinfo(basename($fI['ID_absFile']));
 					if ($this->includeExtFileResources && t3lib_div::inList($this->extFileResourceExtensions,strtolower($html_fI['extension'])))	{
-						$uniquePrefix = '###'.md5(time()).'###';
+						$uniquePrefix = '###'.md5($GLOBALS['SIM_EXEC_TIME']).'###';
 
 						if (strtolower($html_fI['extension'])==='css')	{
 							$prefixedMedias = explode($uniquePrefix, preg_replace('/(url[[:space:]]*\([[:space:]]*["\']?)([^"\')]*)(["\']?[[:space:]]*\))/i', '\1'.$uniquePrefix.'\2'.$uniquePrefix.'\3', $fileRec['content']));
Index: typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php
===================================================================
--- typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php	(revision 5641)
+++ typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php	(working copy)
@@ -333,8 +333,8 @@
 	protected function isDisabled($table, $row) {
 		if (($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled']]) ||
 			($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['fe_group'] && $GLOBALS['TSFE']->simUserGroup && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['fe_group']] == $GLOBALS['TSFE']->simUserGroup) ||
-			($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime']] > time() ) ||
-			($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] < time())) {
+			($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime']] > $GLOBALS['SIM_EXEC_TIME'] ) ||
+			($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] < $GLOBALS['SIM_EXEC_TIME'])) {
 			return true;
 		}
 	}
Index: typo3/sysext/beuser/mod/index.php
===================================================================
--- typo3/sysext/beuser/mod/index.php	(revision 5641)
+++ typo3/sysext/beuser/mod/index.php	(working copy)
@@ -1396,7 +1396,7 @@
 
 				foreach ($dat['users'] as $uDat) {
 					$uItem = '<tr><td width="130">' . t3lib_iconWorks::getIconImage('be_users',$uDat,$GLOBALS['BACK_PATH'],'align="top" title="' . $uDat['uid'] . '"') . $this->linkUser($uDat['username'],$uDat) . '&nbsp;&nbsp;</td><td nowrap="nowrap">' . $this->elementLinks('be_users',$uDat);
-					if ($curUid != $uDat['uid'] && !$uDat['disable'] && ($uDat['starttime'] == 0 || $uDat['starttime'] < time()) && ($uDat['endtime'] == 0 || $uDat['endtime'] > time()))	{
+					if ($curUid != $uDat['uid'] && !$uDat['disable'] && ($uDat['starttime'] == 0 || $uDat['starttime'] < $GLOBALS['SIM_EXEC_TIME']) && ($uDat['endtime'] == 0 || $uDat['endtime'] > $GLOBALS['SIM_EXEC_TIME']))	{
 						$uItem .= '<a href="' . t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'])) . '" target="_top"><img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/su.gif') . ' border="0" align="top" title="' . htmlspecialchars($GLOBALS['LANG']->getLL('switchUserTo', true) . ' ' . $uDat['username']) . ' ' . $GLOBALS['LANG']->getLL('changeToMode', true) . '" alt="" /></a>'.
 							'<a href="' . t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'], 'switchBackUser' => 1)) . '" target="_top"><img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/su_back.gif') . ' border="0" align="top" title="' . htmlspecialchars($GLOBALS['LANG']->getLL('switchUserTo', true) . ' ' . $uDat['username']) . ' ' . $GLOBALS['LANG']->getLL('switchBackMode', true) . '" alt="" /></a>';
 					}
Index: typo3/sysext/install/mod/class.tx_install.php
===================================================================
--- typo3/sysext/install/mod/class.tx_install.php	(revision 5641)
+++ typo3/sysext/install/mod/class.tx_install.php	(working copy)
@@ -1104,7 +1104,7 @@
 						if (t3lib_div::testInt($tt))	{
 							if (filesize($theFile) > $tt*1024)	$ok=1;
 						} else {
-							if (fileatime($theFile) < time()-(intval($tmap[$tt])*60*60*24))	$ok=1;
+							if (fileatime($theFile) < $GLOBALS['SIM_EXEC_TIME']-(intval($tmap[$tt])*60*60*24))	$ok=1;
 						}
 					} else {
 						$ok = 1;
@@ -3673,8 +3673,8 @@
 										'admin' => 1,
 										'uc' => '',
 										'fileoper_perms' => 0,
-										'tstamp' => time(),
-										'crdate' => time()
+										'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
+										'crdate' => $GLOBALS['SIM_EXEC_TIME']
 									);
 
 									$GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertFields);
@@ -3794,8 +3794,8 @@
 										'admin' => 1,
 										'uc' => '',
 										'fileoper_perms' => 0,
-										'tstamp' => time(),
-										'crdate' => time()
+										'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
+										'crdate' => $GLOBALS['SIM_EXEC_TIME']
 									);
 
 									$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertFields);
Index: typo3/sysext/belog/class.tx_belog_webinfo.php
===================================================================
--- typo3/sysext/belog/class.tx_belog_webinfo.php	(revision 5641)
+++ typo3/sysext/belog/class.tx_belog_webinfo.php	(working copy)
@@ -169,7 +169,7 @@
 
 			// Time:
 		$starttime=0;
-		$endtime=time();
+		$endtime=$GLOBALS['SIM_EXEC_TIME'];
 		switch($this->pObj->MOD_SETTINGS['log_time'])		{
 			case 0:
 				// This week
Index: typo3/sysext/belog/mod/index.php
===================================================================
--- typo3/sysext/belog/mod/index.php	(revision 5641)
+++ typo3/sysext/belog/mod/index.php	(working copy)
@@ -260,7 +260,7 @@
 
 
 		$starttime=0;
-		$endtime=time();
+		$endtime=$GLOBALS['SIM_EXEC_TIME'];
 
 		// Time:
 		if ($this->theTime)	{
@@ -267,7 +267,7 @@
 			$starttime = $this->theTime;
 			if ($this->theTime_end)	{
 				$endtime = $this->theTime_end;
-			} else $endtime = time();
+			} else $endtime = $GLOBALS['SIM_EXEC_TIME'];
 		} else {
 			switch($this->MOD_SETTINGS['time'])		{
 				case 0:
Index: typo3/sysext/simulatestatic/class.tx_simulatestatic.php
===================================================================
--- typo3/sysext/simulatestatic/class.tx_simulatestatic.php	(revision 5641)
+++ typo3/sysext/simulatestatic/class.tx_simulatestatic.php	(working copy)
@@ -321,7 +321,7 @@
 					if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
 						$insertFields = array(
 							'md5hash' => $md5,
-							'tstamp'  => time(),
+							'tstamp'  => $GLOBALS['SIM_EXEC_TIME'],
 							'type'    => 1,
 							'params'  => $addParams
 						);
Index: typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
===================================================================
--- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php	(revision 5641)
+++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php	(working copy)
@@ -1928,10 +1928,10 @@
 				return ceil(log($total)/log($max)*100).'%';
 			break;
 			case 'crdate':	// Based on creation date
-				return $this->cObj->calcAge(time()-$row['item_crdate'],0); // ,$conf['age']
+				return $this->cObj->calcAge($GLOBALS['SIM_EXEC_TIME']-$row['item_crdate'],0); // ,$conf['age']
 			break;
 			case 'mtime':	// Based on modification time
-				return $this->cObj->calcAge(time()-$row['item_mtime'],0); // ,$conf['age']
+				return $this->cObj->calcAge($GLOBALS['SIM_EXEC_TIME']-$row['item_mtime'],0); // ,$conf['age']
 			break;
 			default:	// fx. title
 				return '&nbsp;';
Index: typo3/sysext/indexed_search/class.crawler.php
===================================================================
--- typo3/sysext/indexed_search/class.crawler.php	(revision 5641)
+++ typo3/sysext/indexed_search/class.crawler.php	(working copy)
@@ -109,8 +109,8 @@
 			'*',
 			'index_config',
 			'hidden=0
-				AND (starttime=0 OR starttime<='.time().')
-				AND timer_next_indexing<'.time().'
+				AND (starttime=0 OR starttime<='.$GLOBALS['SIM_EXEC_TIME'].')
+				AND timer_next_indexing<'.$GLOBALS['SIM_EXEC_TIME'].'
 				AND set_id=0
 				'.t3lib_BEfunc::deleteClause('index_config')
 		);
@@ -395,7 +395,7 @@
 							'procInstructions' => array('[Index Cfg UID#'.$cfgRec['uid'].']'),
 							'depth' => $params['depth']+1
 						);
-						$pObj->addQueueEntry_callBack($cfgRec['set_id'],$nparams,$this->callBack,$cfgRec['pid'],time()+$this->instanceCounter*$this->secondsPerExternalUrl);
+						$pObj->addQueueEntry_callBack($cfgRec['set_id'],$nparams,$this->callBack,$cfgRec['pid'],$GLOBALS['SIM_EXEC_TIME']+$this->instanceCounter*$this->secondsPerExternalUrl);
 					}
 				}
 			}
@@ -439,7 +439,7 @@
 							'procInstructions' => array('[Index Cfg UID#'.$cfgRec['uid'].']'),
 							'depth' => $params['depth']+1
 						);
-						$pObj->addQueueEntry_callBack($cfgRec['set_id'],$nparams,$this->callBack,$cfgRec['pid'],time()+$this->instanceCounter*$this->secondsPerExternalUrl);
+						$pObj->addQueueEntry_callBack($cfgRec['set_id'],$nparams,$this->callBack,$cfgRec['pid'],$GLOBALS['SIM_EXEC_TIME']+$this->instanceCounter*$this->secondsPerExternalUrl);
 					}
 				}
 			}
@@ -470,7 +470,7 @@
 			// Submit URLs:
 		if (count($res))	{
 			foreach($res as $paramSetKey => $vv)	{
-				$urlList = $pObj->urlListFromUrlArray($vv,$pageRow,time(),30,1,0,$duplicateTrack,$downloadUrls,array('tx_indexedsearch_reindex'));
+				$urlList = $pObj->urlListFromUrlArray($vv,$pageRow,$GLOBALS['SIM_EXEC_TIME'],30,1,0,$duplicateTrack,$downloadUrls,array('tx_indexedsearch_reindex'));
 			}
 		}
 
@@ -499,7 +499,7 @@
 						'procInstructions' => array('[Index Cfg UID#'.$cfgRec['uid'].']'),
 						'depth' => $params['depth']+1
 					);
-					$pObj->addQueueEntry_callBack($cfgRec['set_id'],$nparams,$this->callBack,$cfgRec['pid'],time()+$this->instanceCounter*$this->secondsPerExternalUrl);
+					$pObj->addQueueEntry_callBack($cfgRec['set_id'],$nparams,$this->callBack,$cfgRec['pid'],$GLOBALS['SIM_EXEC_TIME']+$this->instanceCounter*$this->secondsPerExternalUrl);
 				}
 			}
 		}
@@ -731,7 +731,7 @@
 	 * @return	integer		The next time stamp
 	 */
 	function generateNextIndexingTime($cfgRec)	{
-		$currentTime = time();
+		$currentTime = $GLOBALS['SIM_EXEC_TIME'];
 
 			// Now, find a midnight time to use for offset calculation. This has to differ depending on whether we have frequencies within a day or more than a day; Less than a day, we don't care which day to use for offset, more than a day we want to respect the currently entered day as offset regardless of when the script is run - thus the day-of-week used in case "Weekly" is selected will be respected
 		if ($cfgRec['timer_frequency']<=24*3600)	{
@@ -737,7 +737,7 @@
 		if ($cfgRec['timer_frequency']<=24*3600)	{
 			$aMidNight = mktime (0,0,0)-1*24*3600;
 		} else {
-			$lastTime = $cfgRec['timer_next_indexing']?$cfgRec['timer_next_indexing']:time();
+			$lastTime = $cfgRec['timer_next_indexing']?$cfgRec['timer_next_indexing']:$GLOBALS['SIM_EXEC_TIME'];
 			$aMidNight = mktime (0,0,0, date('m',$lastTime), date('d',$lastTime), date('y',$lastTime));
 		}
 
@@ -880,7 +880,7 @@
 					'*',
 					'index_config',
 					'hidden=0
-						AND (starttime=0 OR starttime<='.time().')
+						AND (starttime=0 OR starttime<='.$GLOBALS['SIM_EXEC_TIME'].')
 						AND set_id=0
 						AND type=1
 						AND table2index='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'index_config').'
Index: typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php
===================================================================
--- typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php	(revision 5641)
+++ typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php	(working copy)
@@ -87,8 +87,8 @@
 		$conf['bid'] = intval(t3lib_div::_GET('id'));	// pageid for several statistics
 
 		$addwhere1='';	// all records
-		$addwhere2=' AND tstamp > '.(time()-30*24*60*60);	// last 30 days
-		$addwhere3=' AND tstamp > '.(time()-24*60*60);		// last 24 hours
+		$addwhere2=' AND tstamp > '.($GLOBALS['SIM_EXEC_TIME']-30*24*60*60);	// last 30 days
+		$addwhere3=' AND tstamp > '.($GLOBALS['SIM_EXEC_TIME']-24*60*60);		// last 24 hours
 
 		$content.= $LANG->getLL('title2').'
 			<table cellpading="5" cellspacing="5" valign="top"><tr><td valign="top">'
Index: typo3/sysext/indexed_search/class.indexer.php
===================================================================
--- typo3/sysext/indexed_search/class.indexer.php	(revision 5641)
+++ typo3/sysext/indexed_search/class.indexer.php	(working copy)
@@ -1353,8 +1353,8 @@
 			'item_description' => $this->bodyDescription($this->contentParts),
 			'item_mtime' => $this->conf['mtime'],
 			'item_size' => strlen($this->conf['content']),
-			'tstamp' => time(),
-			'crdate' => time(),
+			'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
+			'crdate' => $GLOBALS['SIM_EXEC_TIME'],
 			'item_crdate' => $this->conf['crdate'],	// Creation date of page
 			'sys_language_uid' => $this->conf['sys_language_uid'],	// Sys language uid of the page. Should reflect which language it DOES actually display!
  			'externalUrl' => 0,
@@ -1512,8 +1512,8 @@
 			'item_mtime' => $mtime,
 			'item_size' => $size,
 			'item_crdate' => $ctime,
-			'tstamp' => time(),
-			'crdate' => time(),
+			'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
+			'crdate' => $GLOBALS['SIM_EXEC_TIME'],
 			'gr_list' => $this->conf['gr_list'],
  			'externalUrl' => $fileParts['scheme'] ? 1 : 0,
  			'recordUid' => intval($this->conf['recordUid']),
@@ -1631,10 +1631,10 @@
 
 			// If there was an indexing of the page...:
 		if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{
-			if ($this->tstamp_maxAge && ($row['tstamp']+$this->tstamp_maxAge) < time())	{	// If max age is exceeded, index the page
+			if ($this->tstamp_maxAge && ($row['tstamp']+$this->tstamp_maxAge) < $GLOBALS['SIM_EXEC_TIME'])	{	// If max age is exceeded, index the page
 				$out = 1;		// The configured max-age was exceeded for the document and thus it's indexed.
 			} else {
-				if (!$this->tstamp_minAge || ($row['tstamp']+$this->tstamp_minAge)<time())	{	// if minAge is not set or if minAge is exceeded, consider at mtime
+				if (!$this->tstamp_minAge || ($row['tstamp']+$this->tstamp_minAge)<$GLOBALS['SIM_EXEC_TIME'])	{	// if minAge is not set or if minAge is exceeded, consider at mtime
 					if ($mtime)	{		// It mtime is set, then it's tested. If not, the page must clearly be indexed.
 						if ($row['item_mtime'] != $mtime)	{	// And if mtime is different from the index_phash mtime, it's about time to re-index.
 							$out = 2;		// The minimum age was exceed and mtime was set and the mtime was different, so the page was indexed.
@@ -1641,7 +1641,7 @@
 						} else {
 							$out = -1;		// mtime matched the document, so no changes detected and no content updated
 							if ($this->tstamp_maxAge)	{
-								$this->log_setTSlogMessage('mtime matched, timestamp NOT updated because a maxAge is set ('.($row['tstamp'] + $this->tstamp_maxAge - time()).' seconds to expire time).',1);
+								$this->log_setTSlogMessage('mtime matched, timestamp NOT updated because a maxAge is set ('.($row['tstamp'] + $this->tstamp_maxAge - $GLOBALS['SIM_EXEC_TIME']).' seconds to expire time).',1);
 							} else {
 								$this->updateTstamp($phash);	// Update the timestatmp
 								$this->log_setTSlogMessage('mtime matched, timestamp updated.',1);
@@ -1723,7 +1723,7 @@
 	 */
 	function updateTstamp($phash,$mtime=0)	{
 		$updateFields = array(
-			'tstamp' => time()
+			'tstamp' => $GLOBALS['SIM_EXEC_TIME']
 		);
 		if ($mtime)	{ $updateFields['item_mtime'] = intval($mtime); }
 
Index: typo3/alt_doc.php
===================================================================
--- typo3/alt_doc.php	(revision 5641)
+++ typo3/alt_doc.php	(working copy)
@@ -862,7 +862,7 @@
 				if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes))	{
 					$aOnClick = 'window.location.href=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&revert=ALL_FIELDS&sumUp=-1&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
 					$buttons['undo'] = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
-							'<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/undo.gif','width="21" height="16"').' class="c-inputButton" title="'.htmlspecialchars(sprintf($LANG->getLL('undoLastChange'),t3lib_BEfunc::calcAge(time()-$undoButtonR['tstamp'],$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))).'" alt="" />'.
+							'<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/undo.gif','width="21" height="16"').' class="c-inputButton" title="'.htmlspecialchars(sprintf($LANG->getLL('undoLastChange'),t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$undoButtonR['tstamp'],$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))).'" alt="" />'.
 							'</a>';
 				}
 				if ($this->getNewIconMode($this->firstEl['table'],'showHistory'))	{
Index: typo3/logomenu.php
===================================================================
--- typo3/logomenu.php	(revision 5641)
+++ typo3/logomenu.php	(working copy)
@@ -160,7 +160,7 @@
 					$elRow = t3lib_BEfunc::getRecord($row['tablename'],$row['recuid']);
 					if (is_array($elRow))	{
 						$items[] = array(
-							'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'],$elRow),$GLOBALS['BE_USER']->uc['titleLen']).' - '.t3lib_BEfunc::calcAge(time()-$row['tstamp_MAX']),
+							'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'],$elRow),$GLOBALS['BE_USER']->uc['titleLen']).' - '.t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$row['tstamp_MAX']),
 							'icon' => array(t3lib_iconworks::getIcon($row['tablename'],$elRow),'width="18" height="16"'),
 							'onclick' => 'content.'.t3lib_BEfunc::editOnClick('&edit['.$row['tablename'].']['.$row['recuid'].']=edit','','dummy.php')
 						);
Index: typo3/classes/class.shortcutmenu.php
===================================================================
--- typo3/classes/class.shortcutmenu.php	(revision 5641)
+++ typo3/classes/class.shortcutmenu.php	(working copy)
@@ -547,7 +547,7 @@
 				'module_name' => $module.'|'.$motherModule,
 				'url'         => $url,
 				'description' => $shortcutName,
-				'sorting'     => time(),
+				'sorting'     => $GLOBALS['SIM_EXEC_TIME'],
 			);
 			$GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_be_shortcuts', $fieldValues);
 
Index: typo3/class.show_rechis.inc
===================================================================
--- typo3/class.show_rechis.inc	(revision 5641)
+++ typo3/class.show_rechis.inc	(working copy)
@@ -368,7 +368,7 @@
 		$tmpTsConfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN',t3lib_BEfunc::getPagesTSconfig($pid));
 		$expirationTime = isset($tmpTsConfig['properties']['default.']['history.']['maxAgeDays']) ? $tmpTsConfig['properties']['default.']['history.']['maxAgeDays'] : 30;
 
-		$expirationTimestamp = $expirationTime ? (time() - 60*60*24*$expirationTime) : 0;
+		$expirationTimestamp = $expirationTime ? ($GLOBALS['SIM_EXEC_TIME'] - 60*60*24*$expirationTime) : 0;
 		$expirationWarning = 0;
 
 		$be_user_array = t3lib_BEfunc::getUserNames();
@@ -410,7 +410,7 @@
 			$singleLine[] = '<span>'.$this->linkPage($image,array('diff' => $sysLogUid)).'</span>';	// remove first link
 
 			$singleLine[] = htmlspecialchars(t3lib_BEfunc::datetime($entry['tstamp']));	// add time
-			$singleLine[] = htmlspecialchars(t3lib_BEfunc::calcAge(time()-$entry['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')));	// add age
+			$singleLine[] = htmlspecialchars(t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME']-$entry['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')));	// add age
 			$singleLine[] = htmlspecialchars($userName);	// add user name
 			$singleLine[] = $this->linkPage($this->generateTitle($entry['tablename'],$entry['recuid']),array('element' => $entry['tablename'].':'.$entry['recuid']),'',$LANG->getLL('linkRecordHistory',1));	// add record UID
 
Index: typo3/install/index.php
===================================================================
--- typo3/install/index.php	(revision 5641)
+++ typo3/install/index.php	(working copy)
@@ -46,7 +46,7 @@
 	// Only allow Install Tool access if the file "typo3conf/ENABLE_INSTALL_TOOL" is found
 $enableInstallToolFile = dirname(dirname(dirname($PATH_thisScript))).'/typo3conf/ENABLE_INSTALL_TOOL';
 
-if (is_file($enableInstallToolFile) && (time() - filemtime($enableInstallToolFile) > 3600)) {
+if (is_file($enableInstallToolFile) && ($GLOBALS['SIM_EXEC_TIME'] - filemtime($enableInstallToolFile) > 3600)) {
 	$content = file_get_contents($enableInstallToolFile);
 	$verifyString = 'KEEP_FILE';
 
Index: typo3/wizard_rte.php
===================================================================
--- typo3/wizard_rte.php	(revision 5641)
+++ typo3/wizard_rte.php	(working copy)
@@ -282,7 +282,7 @@
 			// Undo/Revert:
 			if ($undoButton)	{
 				$buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'show_rechis.php?element=' . rawurlencode($this->P['table'] . ':' . $this->P['uid']) . '&revert=' . rawurlencode('field:' . $this->P['field']) . '&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;') . '">' .
-					'<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge(time() - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
+					'<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['SIM_EXEC_TIME'] - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
 					'</a>';
 			}
 
Index: typo3/mod/tools/em/class.em_unzip.php
===================================================================
--- typo3/mod/tools/em/class.em_unzip.php	(revision 5641)
+++ typo3/mod/tools/em/class.em_unzip.php	(working copy)
@@ -799,7 +799,7 @@
 			$p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
 
 		} else {
-			$p_header['mtime'] = time();
+			$p_header['mtime'] = $GLOBALS['SIM_EXEC_TIME'];
 		}
 
 		// Other informations
@@ -895,7 +895,7 @@
 			$p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
 
 		} else {
-			$p_header['mtime'] = time();
+			$p_header['mtime'] = $GLOBALS['SIM_EXEC_TIME'];
 		}
 
 		// Set the stored filename
Index: t3lib/class.t3lib_tcemain.php
===================================================================
--- t3lib/class.t3lib_tcemain.php	(revision 5641)
+++ t3lib/class.t3lib_tcemain.php	(working copy)
@@ -835,8 +835,8 @@
 								// Setting system fields
 							if ($status=='new')	{
 								if ($TCA[$table]['ctrl']['crdate'])	{
-									$fieldArray[$TCA[$table]['ctrl']['crdate']]=time();
-									if ($createNewVersion)	$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']]=time();
+									$fieldArray[$TCA[$table]['ctrl']['crdate']]=$GLOBALS['SIM_EXEC_TIME'];
+									if ($createNewVersion)	$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']]=$GLOBALS['SIM_EXEC_TIME'];
 								}
 								if ($TCA[$table]['ctrl']['cruser_id'])	{
 									$fieldArray[$TCA[$table]['ctrl']['cruser_id']]=$this->userid;
@@ -846,8 +846,8 @@
 								$fieldArray = $this->compareFieldArrayWithCurrentAndUnset($table,$id,$fieldArray);
 							}
 							if ($TCA[$table]['ctrl']['tstamp'] && count($fieldArray))	{
-								$fieldArray[$TCA[$table]['ctrl']['tstamp']]=time();
-								if ($createNewVersion)	$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']]=time();
+								$fieldArray[$TCA[$table]['ctrl']['tstamp']]=$GLOBALS['SIM_EXEC_TIME'];
+								if ($createNewVersion)	$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']]=$GLOBALS['SIM_EXEC_TIME'];
 							}
 							if ($resetRejected)	{
 								$fieldArray['t3ver_stage'] = 0;
@@ -2960,7 +2960,7 @@
 
 			// System fields being set:
 		if ($TCA[$table]['ctrl']['crdate'])	{
-			$fieldArray[$TCA[$table]['ctrl']['crdate']]=time();
+			$fieldArray[$TCA[$table]['ctrl']['crdate']]=$GLOBALS['SIM_EXEC_TIME'];
 		}
 		if ($TCA[$table]['ctrl']['cruser_id'])	{
 			$fieldArray[$TCA[$table]['ctrl']['cruser_id']]=$this->userid;
@@ -2966,7 +2966,7 @@
 			$fieldArray[$TCA[$table]['ctrl']['cruser_id']]=$this->userid;
 		}
 		if ($TCA[$table]['ctrl']['tstamp'])	{
-			$fieldArray[$TCA[$table]['ctrl']['tstamp']]=time();
+			$fieldArray[$TCA[$table]['ctrl']['tstamp']]=$GLOBALS['SIM_EXEC_TIME'];
 		}
 
 			// Finally, insert record:
@@ -3425,7 +3425,7 @@
 				// First, we create a placeholder record in the Live workspace that represents the position to where the record is eventually moved to.
 			$newVersion_placeholderFieldArray = array();
 			if ($TCA[$table]['ctrl']['crdate'])	{
-				$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']] = time();
+				$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']] = $GLOBALS['SIM_EXEC_TIME'];
 			}
 			if ($TCA[$table]['ctrl']['cruser_id'])	{
 				$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['cruser_id']] = $this->userid;
@@ -3431,7 +3431,7 @@
 				$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['cruser_id']] = $this->userid;
 			}
 			if ($TCA[$table]['ctrl']['tstamp'] && count($fieldArray))	{
-				$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']] = time();
+				$newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['SIM_EXEC_TIME'];
 			}
 
 			if ($table == 'pages') {
@@ -3502,7 +3502,7 @@
 			// Timestamp field:
 		$updateFields = array();
 		if ($TCA[$table]['ctrl']['tstamp'])	{
-			$updateFields[$TCA[$table]['ctrl']['tstamp']] = time();
+			$updateFields[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['SIM_EXEC_TIME'];
 		}
 
 		if ($destPid>=0)	{	// insert as first element on page (where uid = $destPid)
@@ -4018,7 +4018,7 @@
 						);
 
 						if ($TCA[$table]['ctrl']['tstamp']) {
-							$updateFields[$TCA[$table]['ctrl']['tstamp']] = time();
+							$updateFields[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['SIM_EXEC_TIME'];
 						}
 
 							// If the table is sorted, then the sorting number is set very high
@@ -4520,7 +4520,7 @@
 
 											// Write lock-file:
 										t3lib_div::writeFileToTypo3tempDir($lockFileName,serialize(array(
-											'tstamp'=>time(),
+											'tstamp'=>$GLOBALS['SIM_EXEC_TIME'],
 											'user'=>$GLOBALS['BE_USER']->user['username'],
 											'curVersion'=>$curVersion,
 											'swapVersion'=>$swapVersion
@@ -4549,7 +4549,7 @@
 										$swapVersion['pid'] = intval($curVersion['pid']);	// Set pid for ONLINE
 										$swapVersion['t3ver_oid'] = 0;	// We clear this because t3ver_oid only make sense for offline versions and we want to prevent unintentional misuse of this value for online records.
 										$swapVersion['t3ver_wsid'] = $swapIntoWS ? ($t3ver_state['swapVersion']>0 ? $this->BE_USER->workspace : intval($curVersion['t3ver_wsid'])) : 0;	// In case of swapping and the offline record has a state (like 2 or 4 for deleting or move-pointer) we set the current workspace ID so the record is not deselected in the interface by t3lib_BEfunc::versioningPlaceholderClause()
-										$swapVersion['t3ver_tstamp'] = time();
+										$swapVersion['t3ver_tstamp'] = $GLOBALS['SIM_EXEC_TIME'];
 										$swapVersion['t3ver_stage'] = 0;
 										if (!$swapIntoWS)	$swapVersion['t3ver_state'] = 0;
 
@@ -4585,7 +4585,7 @@
 										$curVersion['pid'] = -1;	// Set pid for OFFLINE
 										$curVersion['t3ver_oid'] = intval($id);
 										$curVersion['t3ver_wsid'] = $swapIntoWS ? intval($tmp_wsid) : 0;
-										$curVersion['t3ver_tstamp'] = time();
+										$curVersion['t3ver_tstamp'] = $GLOBALS['SIM_EXEC_TIME'];
 										$curVersion['t3ver_count'] = $curVersion['t3ver_count']+1;	// Increment lifecycle counter
 										$curVersion['t3ver_stage'] = 0;
 										if (!$swapIntoWS)	$curVersion['t3ver_state'] = 0;
@@ -5950,7 +5950,7 @@
 			$fields_values = array();
 			$fields_values['history_data'] = serialize($this->historyRecords[$table.':'.$id]);
 			$fields_values['fieldlist'] = implode(',',array_keys($this->historyRecords[$table.':'.$id]['newRecord']));
-			$fields_values['tstamp'] = time();
+			$fields_values['tstamp'] = $GLOBALS['SIM_EXEC_TIME'];
 			$fields_values['tablename'] = $table;
 			$fields_values['recuid'] = $id;
 			$fields_values['sys_log_uid'] = $logId;
@@ -5967,7 +5967,7 @@
 	 * @return	void
 	 */
 	function clearHistory($maxAgeSeconds=604800,$table)	{
-		$tstampLimit = $maxAgeSeconds ? time()-$maxAgeSeconds : 0;
+		$tstampLimit = $maxAgeSeconds ? $GLOBALS['SIM_EXEC_TIME']-$maxAgeSeconds : 0;
 
 		$GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_history', 'tstamp<'.intval($tstampLimit).' AND tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history'));
 		}
Index: t3lib/class.t3lib_div.php
===================================================================
--- t3lib/class.t3lib_div.php	(revision 5641)
+++ t3lib/class.t3lib_div.php	(working copy)
@@ -5176,7 +5176,7 @@
 			if (!$count) {
 				$insertFields = array(
 					'md5hash' => $md5,
-					'tstamp' => time(),
+					'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
 					'type' => 2,
 					'params' => $inUrl
 				);
Index: t3lib/class.t3lib_iconworks.php
===================================================================
--- t3lib/class.t3lib_iconworks.php	(revision 5641)
+++ t3lib/class.t3lib_iconworks.php	(working copy)
@@ -187,11 +187,11 @@
 				// If "hidden" is enabled:
 			if ($enCols['disabled'])	{ if ($row[$enCols['disabled']]) { $hidden = TRUE; }}
 				// If a "starttime" is set and higher than current time:
-			if ($enCols['starttime'])	{ if (time() < intval($row[$enCols['starttime']]))	{ $timing = TRUE; }}
+			if ($enCols['starttime'])	{ if ($GLOBALS['SIM_EXEC_TIME'] < intval($row[$enCols['starttime']]))	{ $timing = TRUE; }}
 				// If an "endtime" is set:
 			if ($enCols['endtime']) {
 				if (intval($row[$enCols['endtime']]) > 0) {
-					if (intval($row[$enCols['endtime']]) < time()) {
+					if (intval($row[$enCols['endtime']]) < $GLOBALS['SIM_EXEC_TIME']) {
 						$timing = TRUE;	// End-timing applies at this point.
 					} else {
 						$futuretiming = TRUE;		// End-timing WILL apply in the future for this element.
Index: t3lib/class.t3lib_stdgraphic.php
===================================================================
--- t3lib/class.t3lib_stdgraphic.php	(revision 5641)
+++ t3lib/class.t3lib_stdgraphic.php	(working copy)
@@ -2392,7 +2392,7 @@
 			$fieldArr = array (
 				'md5hash' => $md5Hash,
 				'md5filename' => md5($identifyResult[3]),
-				'tstamp' => time(),
+				'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
 				'filename' => $identifyResult[3],
 				'imagewidth' => $identifyResult[0],
 				'imageheight' => $identifyResult[1],
@@ -2554,7 +2554,7 @@
 				return 1;
 			} else {	// If not, we look up in the cache_typo3temp_log table to see if there is a image being rendered right now.
 				$md5Hash=md5($output);
-				$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('md5hash', 'cache_typo3temp_log', 'md5hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($md5Hash, 'cache_typo3temp_log').' AND tstamp>'.(time()-30));
+				$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('md5hash', 'cache_typo3temp_log', 'md5hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($md5Hash, 'cache_typo3temp_log').' AND tstamp>'.($GLOBALS['SIM_EXEC_TIME']-30));
 				if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{	// If there was a record, the image is being generated by another proces (we assume)
 					if (is_object($GLOBALS['TSFE']))	$GLOBALS['TSFE']->set_no_cache();	// ...so we set no_cache, because we dont want this page (which will NOT display an image...!) to be cached! (Only a page with the correct image on...)
 					if (is_object($GLOBALS['TT']))	$GLOBALS['TT']->setTSlogMessage('typo3temp_log: Assume this file is being rendered now: '.$output);
@@ -2563,7 +2563,7 @@
 
 					$insertFields = array(
 						'md5hash' => $md5Hash,
-						'tstamp' => time(),
+						'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
 						'filename' => $output,
 						'orig_filename' => $orig
 					);
Index: t3lib/class.t3lib_userauth.php
===================================================================
--- t3lib/class.t3lib_userauth.php	(revision 5641)
+++ t3lib/class.t3lib_userauth.php	(working copy)
@@ -303,9 +303,9 @@
 		if ($this->isRefreshTimeBasedCookie())	{
 			if (!$this->dontSetCookie)	{
 				if ($cookieDomain)	{
-					SetCookie($this->name, $id, time()+$this->lifetime, '/', $cookieDomain);
+					SetCookie($this->name, $id, $GLOBALS['SIM_EXEC_TIME']+$this->lifetime, '/', $cookieDomain);
 				} else {
-					SetCookie($this->name, $id, time()+$this->lifetime, t3lib_div::getIndpEnv('TYPO3_SITE_PATH'));
+					SetCookie($this->name, $id, $GLOBALS['SIM_EXEC_TIME']+$this->lifetime, t3lib_div::getIndpEnv('TYPO3_SITE_PATH'));
 				}
 				if ($this->writeDevLog) 	t3lib_div::devLog('Update Cookie: '.$id.($cookieDomain ? ', '.$cookieDomain : ''), 't3lib_userAuth');
 			}
@@ -611,7 +611,7 @@
 
 	/**
 	 * Creates a new session ID.
-	 * 
+	 *
 	 * @return	string		The new session ID
 	 */
 	public function createSessionId() {
@@ -829,8 +829,8 @@
 		return  (($this->enablecolumns['rootLevel']) ? 'AND '.$this->user_table.'.pid=0 ' : '').
 				(($this->enablecolumns['disabled']) ? ' AND '.$this->user_table.'.'.$this->enablecolumns['disabled'].'=0' : '').
 				(($this->enablecolumns['deleted']) ? ' AND '.$this->user_table.'.'.$this->enablecolumns['deleted'].'=0' : '').
-				(($this->enablecolumns['starttime']) ? ' AND ('.$this->user_table.'.'.$this->enablecolumns['starttime'].'<='.time().')' : '').
-				(($this->enablecolumns['endtime']) ? ' AND ('.$this->user_table.'.'.$this->enablecolumns['endtime'].'=0 OR '.$this->user_table.'.'.$this->enablecolumns['endtime'].'>'.time().')' : '');
+				(($this->enablecolumns['starttime']) ? ' AND ('.$this->user_table.'.'.$this->enablecolumns['starttime'].'<='.$GLOBALS['SIM_EXEC_TIME'].')' : '').
+				(($this->enablecolumns['endtime']) ? ' AND ('.$this->user_table.'.'.$this->enablecolumns['endtime'].'=0 OR '.$this->user_table.'.'.$this->enablecolumns['endtime'].'>'.$GLOBALS['SIM_EXEC_TIME'].')' : '');
 	}
 
 	/**
@@ -1165,7 +1165,7 @@
 	function gc() {
 		$GLOBALS['TYPO3_DB']->exec_DELETEquery(
 					$this->session_table,
-					'ses_tstamp < '.intval(time()-($this->gc_time)).'
+					'ses_tstamp < '.intval($GLOBALS['SIM_EXEC_TIME']-($this->gc_time)).'
 						AND ses_name = '.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->name, $this->session_table)
 				);
 	}
Index: t3lib/class.t3lib_tceforms.php
===================================================================
--- t3lib/class.t3lib_tceforms.php	(revision 5641)
+++ t3lib/class.t3lib_tceforms.php	(working copy)
@@ -1109,7 +1109,7 @@
 			if (in_array('date',$evalList))	{
 				$checkSetValue = $thisMidnight;
 			} elseif (in_array('datetime',$evalList))	{
-				$checkSetValue = time();
+				$checkSetValue = $GLOBALS['SIM_EXEC_TIME'];
 			} elseif (in_array('year',$evalList))	{
 				$checkSetValue = gmdate('Y');
 			}
@@ -2859,7 +2859,7 @@
 					$value = '';
 				}
 				if ($config['format.']['appendAge'])	{
-					$value .= ' ('.t3lib_BEfunc::calcAge((time()-$itemValue), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')';
+					$value .= ' ('.t3lib_BEfunc::calcAge(($GLOBALS['SIM_EXEC_TIME']-$itemValue), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')';
 				}
 				$itemValue = $value;
 				break;
@@ -5083,7 +5083,7 @@
 	 *
 	 * 		Example use:
 	 *
-	 * 		$msg.='Distribution time (hh:mm dd-mm-yy):<br /><input type="text" name="send_mail_datetime_hr" onchange="typo3form.fieldGet(\'send_mail_datetime\', \'datetime\', \'\', 0,0);"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /><input type="hidden" value="'.time().'" name="send_mail_datetime" /><br />';
+	 * 		$msg.='Distribution time (hh:mm dd-mm-yy):<br /><input type="text" name="send_mail_datetime_hr" onchange="typo3form.fieldGet(\'send_mail_datetime\', \'datetime\', \'\', 0,0);"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /><input type="hidden" value="'.$GLOBALS['SIM_EXEC_TIME'].'" name="send_mail_datetime" /><br />';
 	 * 		$this->extJSCODE.='typo3form.fieldSet("send_mail_datetime", "datetime", "", 0,0);';
 	 *
 	 * 		... and then include the result of this function after the form
Index: t3lib/class.t3lib_modsettings.php
===================================================================
--- t3lib/class.t3lib_modsettings.php	(revision 5641)
+++ t3lib/class.t3lib_modsettings.php	(working copy)
@@ -106,7 +106,7 @@
  *					'desc' => 'descritpion text, not mandatory',
  *					'data' => array(),	// data from MOD_SETTINGS
  *					'user' => NULL, // can be used for extra data used by the application to identify this entry
- *					'tstamp' => 12345, // time()
+ *					'tstamp' => 12345, // $GLOBALS['SIM_EXEC_TIME']
  *				),
  *			'another id' => ...
  *
@@ -325,7 +325,7 @@
 						'desc' => (string)$data['desc'],
 						'data' => $storageData,
 						'user' => NULL,
-						'tstamp' => time(),
+						'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
 					);
 		$storageArr = $this->processEntry($storageArr);
 
Index: t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php
===================================================================
--- t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php	(revision 5641)
+++ t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php	(working copy)
@@ -71,7 +71,7 @@
 			$this->cacheTable,
 			array(
 				'identifier' => $entryIdentifier,
-				'crdate'     => time(),
+				'crdate'     => $GLOBALS['SIM_EXEC_TIME'],
 				'content'    => $data,
 				'tags'       => implode(',', $tags),
 				'lifetime'   => $lifetime
@@ -93,7 +93,7 @@
 			'content',
 			$this->cacheTable,
 			'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' '
-				. 'AND (crdate + lifetime >= ' . time() . ' OR lifetime = 0)'
+				. 'AND (crdate + lifetime >= ' . $GLOBALS['SIM_EXEC_TIME'] . ' OR lifetime = 0)'
 		);
 
 		if (count($cacheEntries) == 1) {
@@ -117,7 +117,7 @@
 			'content',
 			$this->cacheTable,
 			'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' '
-				. 'AND crdate + lifetime >= ' . time()
+				. 'AND crdate + lifetime >= ' . $GLOBALS['SIM_EXEC_TIME']
 		);
 
 		if (count($cacheEntries) == 1) {
@@ -163,7 +163,7 @@
 		$cacheEntryIdentifierRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
 			'identifier',
 			$this->cacheTable,
-			$this->getListQueryForTag($tag) . ' AND (crdate + lifetime >= ' . time() . ' OR lifetime = 0)'
+			$this->getListQueryForTag($tag) . ' AND (crdate + lifetime >= ' . $GLOBALS['SIM_EXEC_TIME'] . ' OR lifetime = 0)'
 		);
 
 		foreach ($cacheEntryIdentifierRows as $cacheEntryIdentifierRow) {
@@ -188,7 +188,7 @@
 		foreach ($tags as $tag) {
 			$whereClause[] = $this->getListQueryForTag($tag);
 		}
-		$whereClause[] = '(crdate + lifetime >= ' . time() . ' OR lifetime = 0)';
+		$whereClause[] = '(crdate + lifetime >= ' . $GLOBALS['SIM_EXEC_TIME'] . ' OR lifetime = 0)';
 
 		$cacheEntryIdentifierRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
 			'identifier',
@@ -253,7 +253,7 @@
 	public function collectGarbage() {
 		$GLOBALS['TYPO3_DB']->exec_DELETEquery(
 			$this->cacheTable,
-			'crdate + lifetime < ' . time() . ' AND lifetime > 0'
+			'crdate + lifetime < ' . $GLOBALS['SIM_EXEC_TIME'] . ' AND lifetime > 0'
 		);
 	}
 
Index: t3lib/class.t3lib_superadmin.php
===================================================================
--- t3lib/class.t3lib_superadmin.php	(revision 5641)
+++ t3lib/class.t3lib_superadmin.php	(working copy)
@@ -1067,7 +1067,7 @@
 		$query = $GLOBALS['TYPO3_DB']->SELECTquery(
 						'sys_log.*, be_users.username  AS username, be_users.admin AS admin',
 						'sys_log,be_users',
-						'be_users.uid=sys_log.userid AND sys_log.type=255 AND sys_log.tstamp > '.(time()-(60*60*24*30)),
+						'be_users.uid=sys_log.userid AND sys_log.type=255 AND sys_log.tstamp > '.($GLOBALS['SIM_EXEC_TIME']-(60*60*24*30)),
 						'',
 						'sys_log.tstamp DESC'
 					);
@@ -1173,7 +1173,7 @@
 							<b>'.htmlspecialchars($label).'</b> ('.htmlspecialchars(substr($all['siteInfo']['SA_PATH'],strlen($all['siteInfo']['MAIN_DIR'])+1)).')<br />';
 
 								// To avoid "visited links" display on next hit:
-							$tempVal='&_someUniqueValue='.time();
+							$tempVal='&_someUniqueValue='.$GLOBALS['SIM_EXEC_TIME'];
 
 								// Add links for update:
 							$url = $this->scriptName.'?type=page&show=rmTempCached&exp='.$k.$tempVal;
Index: t3lib/class.t3lib_beuserauth.php
===================================================================
--- t3lib/class.t3lib_beuserauth.php	(revision 5641)
+++ t3lib/class.t3lib_beuserauth.php	(working copy)
@@ -163,7 +163,7 @@
 		if ($flag && t3lib_extMgm::isLoaded('beuser_tracking'))	{
 			$insertFields = array(
 				'userid' => intval($this->user['uid']),
-				'tstamp' => time(),
+				'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
 				'script' => t3lib_div::getIndpEnv('REQUEST_URI')
 			);
 
Index: t3lib/config_default.php
===================================================================
--- t3lib/config_default.php	(revision 5641)
+++ t3lib/config_default.php	(working copy)
@@ -543,7 +543,7 @@
 
 
 	// Setting some global vars:
-$EXEC_TIME = time();					// $EXEC_TIME is set so that the rest of the script has a common value for the script execution time
+$EXEC_TIME = $_SERVER['REQUEST_TIME'];					// $EXEC_TIME is set so that the rest of the script has a common value for the script execution time
 $SIM_EXEC_TIME = $EXEC_TIME;			// $SIM_EXEC_TIME is set to $EXEC_TIME but can be altered later in the script if we want to simulate another execution-time when selecting from eg. a database
 $ACCESS_TIME = $EXEC_TIME - ($EXEC_TIME % 60);		// $ACCESS_TIME is a common time in minutes for access control
 $SIM_ACCESS_TIME = $ACCESS_TIME;		// if $SIM_EXEC_TIME is changed this value must be set accordingly
Index: t3lib/class.t3lib_befunc.php
===================================================================
--- t3lib/class.t3lib_befunc.php	(revision 5641)
+++ t3lib/class.t3lib_befunc.php	(working copy)
@@ -1645,7 +1645,7 @@
 	public static function dateTimeAge($tstamp, $prefix = 1, $date = '') {
 		return $tstamp ?
 				($date=='date' ? t3lib_BEfunc::date($tstamp) : t3lib_BEfunc::datetime($tstamp)).
-				' ('.t3lib_BEfunc::calcAge($prefix*(time()-$tstamp), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')' : '';
+				' ('.t3lib_BEfunc::calcAge($prefix*($GLOBALS['SIM_EXEC_TIME']-$tstamp), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')' : '';
 	}
 
 	/**
@@ -2194,7 +2194,7 @@
 				case 'input':
 					if ($value) {
 						if (t3lib_div::inList($theColConf['eval'], 'date')) {
-							$l = t3lib_BEfunc::date($value).' ('.(time()-$value>0?'-':'').t3lib_BEfunc::calcAge(abs(time()-$value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')';
+							$l = t3lib_BEfunc::date($value).' ('.($GLOBALS['SIM_EXEC_TIME']-$value>0?'-':'').t3lib_BEfunc::calcAge(abs($GLOBALS['SIM_EXEC_TIME']-$value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')';
 						} elseif (t3lib_div::inList($theColConf['eval'], 'time')) {
 							$l = t3lib_BEfunc::time($value, FALSE);
 						} elseif (t3lib_div::inList($theColConf['eval'], 'timesec')) {
@@ -2928,8 +2928,8 @@
 	public static function compilePreviewKeyword($getVarsStr, $beUserUid, $ttl = 172800, $fullWorkspace = NULL) {
 		$field_array = array(
 			'keyword' => md5(uniqid(microtime())),
-			'tstamp' => time(),
-			'endtime' => time()+$ttl,
+			'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
+			'endtime' => $GLOBALS['SIM_EXEC_TIME']+$ttl,
 			'config' => serialize(array(
 				'fullWorkspace' => $fullWorkspace,
 				'getVars' => $getVarsStr,
@@ -4161,10 +4161,10 @@
 		if ($pageinfo['fe_group']>0) {
 			$simUser = '&ADMCMD_simUser='.$pageinfo['fe_group'];
 		}
-		if ($pageinfo['starttime']>time()) {
+		if ($pageinfo['starttime']>$GLOBALS['SIM_EXEC_TIME']) {
 			$simTime = '&ADMCMD_simTime='.$pageinfo['starttime'];
 		}
-		if ($pageinfo['endtime']<time() && $pageinfo['endtime']!=0) {
+		if ($pageinfo['endtime']<$GLOBALS['SIM_EXEC_TIME'] && $pageinfo['endtime']!=0) {
 			$simTime = '&ADMCMD_simTime='.($pageinfo['endtime']-1);
 		}
 		return $simUser.$simTime;
Index: t3lib/class.t3lib_userauthgroup.php
===================================================================
--- t3lib/class.t3lib_userauthgroup.php	(revision 5641)
+++ t3lib/class.t3lib_userauthgroup.php	(working copy)
@@ -1699,7 +1699,7 @@
 		if ($email)	{
 
 				// get last flag set in the log for sending
-			$theTimeBack = time()-$secondsBack;
+			$theTimeBack = $GLOBALS['SIM_EXEC_TIME']-$secondsBack;
 			$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
 							'tstamp',
 							'sys_log',
