Created
June 25, 2012 17:22
-
-
Save irwinv/2989998 to your computer and use it in GitHub Desktop.
Calcule des heures passé sur un test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$conn = $this->container->get('database_connection'); | |
$tempspasse = $conn->fetchAll( | |
"SELECT *, MIN(ddt.datedebut) FROM DateDebutTest ddt | |
LEFT JOIN ResultatsTests rt ON ddt.utilisateur_id = rt.utilisateur_id | |
WHERE rt.test_id = ddt.test_id | |
&& rt.question_id = ddt.question_id | |
&& ddt.test_id = $id" | |
); | |
$datedebut = new \Datetime($tempspasse[0]['datedebut']); | |
$datefin = new \Datetime($tempspasse[0]['date_fin']); | |
$diff = $datedebut->diff($datefin); | |
// $temp_examen= $diff->format('%y-%m-%d %h:%i:%s'); | |
$temp_examen= $diff->format('%h hr : %i mm : %s sec'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment