EsFacturesDevis
esfacturesdevis
Ressources
Newsletter

E-mail :

Générateurs et Services
Call Back
CallBack

Codes Sources PHP / mySQL : Afficher la date au format français

Afficher la date au format français
Afficher la date mySQL (yyyy-mm-dd) au format français (dd-mm-yyyy).
<?php

function dateFrench($date
{
    if((
$len_date=strlen($date)) == 10
    { 
    return 
eregi_replace("([0-9]{4})-([0-9]{2})-([0-9]{2})","\\3/\\2/\\1",$date); 
    } 
    elseif(
$len_date == 19
    { 
    return 
eregi_replace("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})","\\3/\\2/\\1 à \\4h\\5",$date); 
    }

    return 
false
}

echo(
dateFrench("2007--07-09"));

?>
Informations
Date d'ajout : 09/07/2007
Catégorie : Date / Heure
Vues : 687
Auteur : Lejeune Cédric
[ Site Web ] [ Email ]

Catégories
- Algorithmes 2
- Caractères 1
- Date / Heure 4
- Emails 2
- Fichiers 3
- Graphique 3
- LDAP 0
- MySQL 3
- Réseau 1

Partenaires : 01php.Com | AdDesign.Fr | ComScripts | E-audience | Easy-Script.Com | Le1er.Fr | Lucchio-Design.Net | Noogle | Vous ?

Fermer