Find Difference between leader and Previous in results table

后端 未结 2 1185
攒了一身酷
攒了一身酷 2021-01-26 00:15

Edited: (added table example)

With your help guys I\'m in this place that I have information in table ( Name, team, start time finish time and even time between these tw

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-26 00:27

    $date2 = date_create($date2InString);
    $date1 = date_create($date1InString);
    date_diff($date2, $date1)->format('%h %i %s' );
    

    for more formats: http://php.net/manual/en/function.date-diff.php

    below code should do what you asked for

    $timestamp = strtotime($row['synd']);
     print '';
      print '' .$row["ranking"].'';
     print ''.removeParanthesis($row["klass"]).'';
       print ''.$row["nimi"].'  '.$row["Perekonnanimi"].'';
         print ''.$date = date('d-m-Y', $timestamp).'';
        print ''.$row["teamnimi"].'';
    print ''.$row["start"].'';
    print ''.$row["finish"].'';
    print ''.$row["aeg"].'';
    print ''.$row["difleader"].'';
    print ''.$row["difprev"].'';
    $date2 = date_create($row["difprev"]);
    $date1 = date_create($row["difleader"]);
    date_diff($date2, $date1)->format('%h %i %s' );
    print ''.$row["speed"].'';
     print '';
    

提交回复
热议问题