---
title: "tt_calender Anzeige der Uhrzeit"
url: "https://www.typo3.net/d/17368-tt-calender-anzeige-der-uhrzeit"
source: "typo3.net"
tags: ["Extensions","Frage","Kalender & Termine"]
created: "2004-10-28"
last_reply: "2009-09-24"
replies: 3
solved: false
page: 1
pages: 1
lang: "de"
---

# tt_calender Anzeige der Uhrzeit

Extensions · 3 Antworten · gestartet 2004-10-28

## Eröffnungsbeitrag

**cleopold** · 2004-10-28 · [Beitrag #1](https://www.typo3.net/d/17368-tt-calender-anzeige-der-uhrzeit/1)

Ich bin PHP-technisch nicht wirklich drauf, darum die Frage.

Wie muß ich die calender.inc ändern, damit unter dem Datum auch die Uhrzeit angezeigt wird. Man kann die Uhrezit zwar im Bachend eingeben, aber im Frontend wird sie nicht dargestellt.

Danke!

## Antworten

### [#2](https://www.typo3.net/d/17368-tt-calender-anzeige-der-uhrzeit/2) · cleopold · 2004-10-29

Ich habe mittlerweile gefunden, daß die Zeit im Template hinterlegt ist.

<td align="right" valign="top"><font face="###FONT###" size=1 color="black">###TIME###</font></td>

Allerdings wird die Zeit nicht angezeigt.
Das Problem ist wohl hier irgendwo versteckt:

**
 * calendar.inc
 *
 * Creates a calendar
 *
 * NOTICE: This script does not represent the most effective way to insert custom functionality in TYPO3 page. Please use the USER object with a class instead.
 *
 * @author	Kasper Skårhøj <kasper@typo3.com>
 */

$content="";

// *************************************
// *** getting configuration values:
// *************************************

// getting configuration values:
	$config["pid_list"] = trim($this->stdWrap($conf["pid_list"],$conf["pid_list."]));
	$config["pid_list"] = $config[pid_list] ? $config["pid_list"] : $GLOBALS["TSFE"]->id;

$config["recursive"] = $this->stdWrap($conf["recursive"],$conf["recursive."]);

$config["font"] = $this->stdWrap($conf["fontFace"],$conf["fontFace."]);
	$config["font"] = $config["font"] ? $config["font"] : "verdana";

// If the current record should be displayed.
	$config["displayCurrentRecord"] = $conf["displayCurrentRecord"];

$templateCode = $this->fileResource($conf["templateFile"]);

// Fetching catagories:
	$categories = Array();
 	$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_calender_cat', '1=1'.$this->enableFields('tt_calender_cat'));
	while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{
		$categories[$row['uid']] = $row['title'];
	}

// making query:
	$selectConf = Array();
	if ($config[recursive])	{		// get pid-list if recursivity is enabled
		$pid_list_arr = explode(",",$config[pid_list]);
		$orig_pids = $config[pid_list];
		$config[pid_list]="";
		while(list(,$val)=each($pid_list_arr))	{
			$config[pid_list].=$this->getTreeList($val,intval($config["recursive"]));
		}
		$config[pid_list].=$orig_pids;
	}
	$selectConf["pidInList"] = $config[pid_list];
	$selectConf["orderBy"] = "date,time";
	$selectConf["where"] = "type=0";
	if (intval($conf["maxAge"]))	{
		$selectConf["where"].= " AND date>".(time()-(3600*24*intval($conf["maxAge"])));
	}

// performing query:
 	$res = $this->exec_getQuery("tt_calender",$selectConf);

		// traversing the data.
	$tableRows = "";
	$day_base = mktime (0,0,0,date("m"),date("d"),date("Y"));

// config af template:
	$tConf["template"] ="HTML";
	$tConf["template."]["value"] = $templateCode;

	while($config["displayCurrentRecord"] || $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{
		if ($config["displayCurrentRecord"])	{$row = $this->data;}
			// Insering date header:
		$tConf["workOnSubpart"] = "DATE_HEADER";
		$tConf["marks."] = Array ();
		$tConf["marks."]["DATE"]="HTML";
		$tConf["marks."]["DATE."]["value"]=date("d.m.Y",$row[date]);
		$tConf["marks."]["HEADER"]="HTML";
		$tConf["marks."]["HEADER."]["value"]=$row[title];
		$tConf["marks."]["FONT"]="HTML";
		$tConf["marks."]["FONT."]["value"]=$config[font];
		$tableRows.=$this->TEMPLATE($tConf);

$parts = explode(chr(10)."---".chr(10), str_replace(chr(13),"",$row[note]));
		while(list(,$pcon)=each($parts))	{
			$pcon=trim($pcon);
			$pcon_arr=split(chr(10),$pcon,2);
			$theTime = "";

$hP=explode(" ",$pcon_arr[0],2);
			if (ereg("[^0-9,.:;-]",$hP[0]))	{
				$title = trim($pcon_arr[0]);
			} else {
				$title = trim($hP[1]);
				$theTime = trim($hP[0]);
			}
			if ($conf["parseFunc."]) {
				$title = $this->parseFunc($title,$conf["parseFunc."]);
				$pcon_arr[1] = $this->parseFunc($pcon_arr[1],$conf["parseFunc."]);
			}
			$theContent = "<b>".$title."</b><BR>".nl2br($pcon_arr[1]);

// Insering date header:
			$tConf["workOnSubpart"] = "DATE_CONTENT";
			$tConf["marks."] = Array ();
			$tConf["marks."]["TIME"]="HTML";
			$tConf["marks."]["TIME."]["value"]= $theTime;
			$tConf["marks."]["CONTENT"]="HTML";
			$tConf["marks."]["CONTENT."]["value"]=$theContent;
			$tConf["marks."]["FONT"]="HTML";
			$tConf["marks."]["FONT."]["value"]=$config[font];
			$tableRows.=$this->TEMPLATE($tConf);

		}

$this->lastChanged($row[tstamp]);

if ($config["displayCurrentRecord"])	{break;}	// Must exit forcibly or we'll have an eternal loop.
	}

$tConf["workOnSubpart"] = "TEMPLATE_CALENDAR";
	$tConf["marks."] = Array ();
	$tConf["subparts."] = Array ();
	$tConf["subparts."]["TABLE_CONTENT"]="HTML";
	$tConf["subparts."]["TABLE_CONTENT."]["value"]= $tableRows;

$content = $this->TEMPLATE($tConf);

$RESTORE_OLD_DATA = 1;		// secures a restore of the original ->data-array

?>

Weiß hier jemand Rat???

### [#3](https://www.typo3.net/d/17368-tt-calender-anzeige-der-uhrzeit/3) · Raptor · 2005-09-04

Steht im Manual: Die Zeit wird aus dem Text genommen. Gib mal in das Textfeld Folgendes ein:

20:00 The café opens
Today's special is.....
---
01:00 Closing time

Und schau dann mal, was passiert ;-) Wieso das so ist, ist aber eine gute Frage, was sich der Herr dabei überlegt hat....

### [#4](https://www.typo3.net/d/17368-tt-calender-anzeige-der-uhrzeit/4) · Chuonrad · 2009-09-24

Zwar uralt.
Da ich aber grad gesucht - und nichts gutes gefunden habe, mal hier meine Lösung:

Man kann die Zeit aus dem Feld "Zeit" nehmen, wenn man in der calendar.inc folgendes ändert:

```php
$tConf["marks."]["TIME"]="HTML";
$tConf["marks."]["TIME."]["value"]= floor($row[time]/3600).":".sprintf("%02d",floor($row[time]/60)-60*floor($row[time]/3600));
```

Das "Zeitfeld" gibt die eingegebene Zeit in Sekunden aus - also habe ich das wieder zurück gerechnet.
Vielleicht gehts auch noch viel eleganter. :)

---

Quelle: „tt_calender Anzeige der Uhrzeit“, typo3.net, https://www.typo3.net/d/17368-tt-calender-anzeige-der-uhrzeit
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
