<!doctype html> <html lang="fr"> <head> <meta charset="utf-8" /> <title>Test !</title> </head> <body> <?php date_default_timezone_set('Europe/Paris'); var_dump(new DateTime()); echo "<div>var_dump</div>"; date_default_timezone_set('Africa/Casablanca'); var_dump(new DateTime()); echo "<div>var_dump</div>"; ?> </body> </html>Et voici le résultat :
object(DateTime)[1] public 'date' => string '2013-10-21 20:14:59' (length=19) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/Paris' (length=12) var_dump object(DateTime)[1] public 'date' => string '2013-10-21 18:14:59' (length=19) public 'timezone_type' => int 3 public 'timezone' => string 'Africa/Casablanca' (length=17) var_dumpJe ne vois aucun problème.