par
Aureusms » 16 août 2010, 10:15
Slt Stealth35,
Je suis d'accord avec toi . Pas très grand spécialiste en date(), j'ai cependant quelques questions :
Je crois me rappeler que strtotime demande une date en format anglais.
$maintenant = strtotime('03-29-2010');
$hier = strtotime('-1 day', $maintenant); //ou '1 day ago'
$nom_hier = date ("Ymd",$hier);
echo $nom_hier;
Pourrait-on envisager :
$maintenant = time();
$hier = strtotime('-1 day', $maintenant); //ou '1 day ago'
$nom_hier = date ("Ymd",$hier);
echo $nom_hier;
Ou encore :
$maintenant = strtotime(date("d-m-Y",time()));
$hier = strtotime('-1 day', $maintenant); //ou '1 day ago'
$nom_hier = date ("Ymd",$hier);
echo $nom_hier;
Je pencherai pour la dernière... Confirmes-tu ?
Slt Stealth35,
Je suis d'accord avec toi . Pas très grand spécialiste en date(), j'ai cependant quelques questions :
Je crois me rappeler que strtotime demande une date en format anglais.
[php]$maintenant = strtotime('03-29-2010');
$hier = strtotime('-1 day', $maintenant); //ou '1 day ago'
$nom_hier = date ("Ymd",$hier);
echo $nom_hier;[/php]
Pourrait-on envisager :
[php]$maintenant = time();
$hier = strtotime('-1 day', $maintenant); //ou '1 day ago'
$nom_hier = date ("Ymd",$hier);
echo $nom_hier;[/php]
Ou encore :
[php]$maintenant = strtotime(date("d-m-Y",time()));
$hier = strtotime('-1 day', $maintenant); //ou '1 day ago'
$nom_hier = date ("Ymd",$hier);
echo $nom_hier;[/php]
Je pencherai pour la dernière... Confirmes-tu ?