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.

Parameterübergabe // Zeitproblem (PHP)

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe folgendes Problem: mit Parametern übergebe ich von einer Seite an eine andere jeweils zwei Datumswerte (Beginn und Ende einer Periode, Format TT.MM.JJJJ). Auf der "nachfolgenden" Seite werden diese beiden Datumswerte umgewandelt in das für MySQL passende Format YYYY-MM-DD.

Bis hierhin funktioniert auch alles.

Ich muß diese beiden Werte allerdings mit DATETIME-Werten vergleichen, die entsprechend noch eine Uhrzeit haben.

Das heißt also, daß die Variablen jetzt so umgewandelt werden:


$start = $_GET['startdate'];
$ende = $_GET['enddate'];

list($tag, $monat, $jahr) = explode(".", $start);
$start = sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);
echo $start;

list($tag, $monat, $jahr) = explode(".", $ende);
$ende = sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);
echo $ende;
[/PHP]

Ich hätte jetzt gerne, daß zu $start und $ende aber noch die Uhrzeiten festgelegt werden können (d.h. bei $start 00:00:00 und $ende 23:59:59).

Wahrscheinlich hab ich mich gerade etwas umständlich ausgedrückt, aber vielleicht weiß trotzdem jemand, was ich mein(t)e.

Danke schon mal für Eure Hilfe,

Grüße,

-etops-

hi,

also wenn ich dich richtig verstanden habe dann doch einfach

$start .= "00:00:00";

$ende .= "23:59:59";

gruß

blue ;)

Ja, danke :) ...so ähnlich hab ich es mittlerweile gelöst - hatte einfach ein Brett vor dem Kopf.

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.