diff --git a/ACTUALITE/index.php b/ACTUALITE/index.php index c1e2a66..d7595cd 100644 --- a/ACTUALITE/index.php +++ b/ACTUALITE/index.php @@ -43,36 +43,27 @@ Bonne lecture ! --> - - setTimezone(new \DateTimeZone('Europe/Paris')); - - return sprintf('%s', $commitDate->format('d/m/Y à H:i:s')); - } - } - - // echo 'Version du site : ' . Version::get(); - - ?> + } + class DateVersion { + public static function get() { + $commitDate = new \DateTime(trim(exec('git log -n1 --pretty=%ci index.php'))); + $commitDate->setTimezone(new \DateTimeZone('Europe/Paris')); + return sprintf('%s', $commitDate->format('d/m/Y à H:i:s')); + } + } + + // echo 'Version du site : ' . Version::get(); + +?> +