/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// transforme une date 31/07/2007 en 2007-07-31 et inversemment sans heure function neo_date_transform ($date, $separator){ switch ($separator) { case "/": $jour = $split[0]; $mois = $split[1]; $annee = $split[2]; return $date = $annee . "-" . $mois . "-" . $jour; case "-": $annee = $split[0]; $mois = $split[1]; return $date = $jour . "/" . $mois . "/" . $annee; } }