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.

Datum umwandeln

Empfohlene Antworten

Veröffentlicht

Kann mir jemand helfen warum folgendes nicht funktioniert?

<?php

/**
* date_mysql2german
* wandelt ein MySQL-DATE (ISO-Date)
* in ein traditionelles deutsches Datum um.
*/
function date_mysql2german($datum) {
list($jahr, $monat, $tag) = explode("-", $datum);

return sprintf("%02d.%02d.%04d", $tag, $monat, $jahr);
}


/**
* date_german2mysql
* wandelt ein traditionelles deutsches Datum
* nach MySQL (ISO-Date).
*/
function date_german2mysql($datum) {
list($tag, $monat, $jahr) = explode(".", $datum);

return sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);
}


date_mysql2german("1999-01-01");
date_german2mysql("01.01.1999");
?> [/PHP]

Wieso? Funktioniert doch!

Grüße, Tobias

Was soll das heißen bei die funktioniert nichts? Was willst Du denn erreichen? Bei mir schmeißt er keine Fehlermeldung, sondern führt das Script ganz normal aus.

Kann mir jemand helfen warum folgendes nicht funktioniert?

<?php

/**
* date_mysql2german
* wandelt ein MySQL-DATE (ISO-Date)
* in ein traditionelles deutsches Datum um.
*/
function date_mysql2german($datum) {
list($jahr, $monat, $tag) = explode("-", $datum);

return sprintf("%02d.%02d.%04d", $tag, $monat, $jahr);
}


/**
* date_german2mysql
* wandelt ein traditionelles deutsches Datum
* nach MySQL (ISO-Date).
*/
function date_german2mysql($datum) {
list($tag, $monat, $jahr) = explode(".", $datum);

return sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);
}

// echos
echo date_mysql2german("1999-01-01");
echo date_german2mysql("01.01.1999");
?> [/PHP]

Wie wäre es mit einem klassichen echo? (siehe oben)

du gibts die werte ja in den funktionen zurück

also musst du sie auch ausgeben ^^

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.