Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP: Gestriges Datum

Empfohlene Antworten

Veröffentlicht

Per "Date" kann man sich ja das heutige Datum ausgeben lassen.

Was ist aber, wenn ich das gestrige Datum oder ein Datum, dass x Tage zurückliegt, ausgegeben haben will?

Ich hatte erst die Idee, das Datum zu zerpflücken und den Tag - 1 bzw. - x zu setzen, aber das geht natürlich nicht am Ersten eines Monats.

Gibt's andere Möglichkeiten?

Hier mal ein bisschen allgemeine PHP-Datumsinformation.

Das Standard-Zeitformat in PHP ist der UNIX-Timestamp. Er gibt die seit 1.1.1970(Beginn der UNIX-Ära) vergangenen Sekunden an. Daher kannst du auf den gestrigen Tag oder jeden bliebien anderen auch kommen, indem du die Zahl der Sekunden pro Tag mit der Zahl der Tage mutiplizierst und dann von time() abziehst.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.