Utilisation de ‘strtotime()’ pour lire et convertir la date au format englais

Author:

 date
Download

<?php

$mydatestrings = array("now", "today", "tomorrow", "yesterday",
"friday", "next friday", "last saturday", "+5 hours", "-1 month", "+30 minutes",
"30 seconds", "+2 years -1 month","last week", "next week","last month", "last year", "4 weeks ago"
);

foreach($mydatestrings as $mydate)
{
    echo "$mydate:" . date('r', strtotime($mydate)) ."<br/>";
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *


− 6 = two