]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/scripts/public_html/common.php
fix
[helm.git] / helm / matita / scripts / public_html / common.php
index 81a0565cf9faad81de5f47dc0258cf83db688cd0..10aeb8d823a025758c0a51dc349917c1fb48be84 100644 (file)
@@ -25,6 +25,17 @@ function query($q) {
   }
 }
 
+function time_2_cents($t) {
+  $matches = array();
+  $rex = "/^(\d+)m(\d{2})\.(\d{2})s$/";
+  $m = preg_match($rex,$t,$matches);
+  if ( $m == 0 ) exit 1;
+  $t_minutes = $matches[1];
+  $t_secs = $matches[2];
+  $t_cents = $matches[3];
+  return ((int) $t_cents) + ((int) $t_secs) * 100 + ((int)$t_minutes) * 6000 ;
+}
+
 function sum_time($t1, $t2) {
   $matches1 = array();
   $matches2 = array();