Zum Inhalt springen

Scoutnet-Kalender: immer eine Stunde zuviel

Erstellt am 14. Oktober 2004 · 2 Antworten · letzte Antwort am 30. Januar 2006

Tags: Kalender & Termine, Frage

theis ·

Hallo zusammen

bei mir zeigt es beim Kalender immer eine Stunde zuviel an.
Habe mal in der Datenbank nachgeschaut, aber da scheint alles in Ordnung zu sein.
Für 17.00 steht da 61200 und das scheint in Ordnung.
Die Ausgabe zeigt aber 18.00 an.

Was ist da falsch, oder habe ich etwas nicht richtig eingestellt???

Gruss Theis

theis ·

habe es selber rausbekommen.

das problem ist die Zeitzone, da ich in der Zeitzone +1
lebe, wird in der Funktion strftime immer eine Stunde dazugezählt.

siehe auch http://ch2.php.net/strftime

Given a 'bare number' in seconds, e.g. 143567, strftime() will format this number ACCORDING TO YOUR LOCAL TIMEZONE. Thus, for Germany (where you probably are, since you have a .de address) you will get an extra hour, since CET is GMT +1.

Habe das Problem wiefolgt gelöst:
in der datei "pi1/class.tx_spscoutnetcalendar_pi1.php " ab der Zeile 553 sieht es jetzt so aus:

				// if no start or enddate are entered through the backend interface, 
				//0 is saved in the db this would result in a display of 1.1.1970 1.00 
				//which is not really wanted. A -1 solves this while displaying nothing.

				$markerArray["###DAY###"] = ($i==0) ? strftime($this->conf["dateFormat"],$timestamp) : "";

				$markerArray["###TITLE###"] = $this->CalendarEntries[$timestamp][$i][title];
				$markerArray["###SDATE###"] = strftime($this->conf["dateFormat"],$this->CalendarEntries[$timestamp][$i][sdate]);
				$markerArray["###DAY###"] = ($i==0) ? strftime($this->conf["dateFormat"],$timestamp) : "";
                if($this->CalendarEntries[$timestamp][$i][stime]<>0)
                {
				  $markerArray["###STIME###"] = strftime($this->conf["timeFormat"],$this->CalendarEntries[$timestamp][$i][stime]-3600);
                }
                else
                {
				  $markerArray["###STIME###"] = "";
                }
      
				$markerArray["###EDATE###"] = strftime($this->conf["dateFormat"],$this->CalendarEntries[$timestamp][$i][edate]);
                if($this->CalendarEntries[$timestamp][$i][etime]<>0)
                {
				  $markerArray["###ETIME###"] = strftime($this->conf["timeFormat"],$this->CalendarEntries[$timestamp][$i][etime]-3600);
                }
                else
                {
				  $markerArray["###ETIME###"] = "";
                }
				$markerArray["###PLACE###"] = $this->CalendarEntries[$timestamp][$i][place];
				$markerArray["###AUTHOR###"] = $this->CalendarEntries[$timestamp][$i][author];

im oberen Beispiel habe ich auch noch gemacht, dass wenn die Zeit 0 ist, dass dann die Zeit gar nicht angezeigt wird.

Gruss Theis

einpraegsam.​net ·

Klasse Tip, sollte nicht in Vergessenheit geraten, hier nochmal der PHP Code für Mitteleuropäische Zeit und automatisches Ausblenden der Endzeit und Enddatum, wenn keine Eingabe erfolgt ist:

				//$markerArray["###STIME###"] = strftime($this->conf["timeFormat"],$this->CalendarEntries[$timestamp][$i][stime]);
				$markerArray["###STIME###"] = strftime($this->conf["timeFormat"],$this->CalendarEntries[$timestamp][$i][stime]-3600);
				
				//$markerArray["###EDATE###"] = strftime($this->conf["dateFormat"],$this->CalendarEntries[$timestamp][$i][edate]);
				//$markerArray["###ETIME###"] = strftime($this->conf["timeFormat"],$this->CalendarEntries[$timestamp][$i][etime]);
				
				// Wenn kein End Datum, dann nichts anzeigen
				if($this->CalendarEntries[$timestamp][$i][edate]<>-1)
                {
                                  $markerArray["###EDATE###"] = strftime($this->conf["dateFormat"],$this->CalendarEntries[$timestamp][$i][edate]);
                }
                else
                {
                                  $markerArray["###EDATE###"] = "";
                }
                
				// Wenn keine End Zeit, dann nichts anzeigen
				if($this->CalendarEntries[$timestamp][$i][etime]<>-1)
                {
                                  $markerArray["###ETIME###"] = strftime($this->conf["timeFormat"],$this->CalendarEntries[$timestamp][$i][etime]-3600);
                }
                else
                {
                                  $markerArray["###ETIME###"] = "";
                }

Zeile 556 in der class.tx_spscoutnetcalendar_pi1.php