Ticket #357 (closed Bug report: duplicate)

Opened 15 years ago

Last modified 14 years ago

Wrong display of start of connection time

Reported by: leandro@… Owned by:
Priority: normal Milestone: Not yet assigned to a Milestone
Component: Auth server, Statistics and reporting Version:
Keywords: Cc:


I just notice the "Date" field in the connection statistics is wrong, displaying 6 hours before the correct date and time. In the database the data is correct, but it is displayed wrong.

Here the little patch to the file wifidog/classes/StatisticReport/ConnectionLog.php

--- ConnectionLog.php.orig      2007-07-17 15:38:23.000000000 +0200
+++ ConnectionLog.php   2007-07-24 18:25:10.000000000 +0200
@@ -148,7 +148,7 @@
             $html .= "</table>";
             $html .= "</fieldset>";

-            $candidate_connections_sql = $this->stats->getSqlCandidateConnectionsQuery("users.username, nodes.name, EXTRACT('EPOCH' FROM date_trunc('second',timestamp_out-timestamp_in)) AS time_spent, EXTRACT('EPOCH' FROM timestamp_in) AS timestamp_in, connections.user_id, user_mac ", true);
+            $candidate_connections_sql = $this->stats->getSqlCandidateConnectionsQuery("users.username, nodes.name, EXTRACT('EPOCH' FROM date_trunc('second',timestamp_out-timestamp_in)) AS time_spent, timestamp_in, connections.user_id, user_mac ", true);

             $sql = "$candidate_connections_sql ORDER BY timestamp_in DESC";
             $db->execSql($sql, $rows, false);
@@ -181,7 +181,7 @@
                     $html .= "  <td>{$row['name']}</td>\n";
                     $html .= "  <td>{$row['username']}</td>\n";
                     $html .= "  <td>{$row['user_mac']}</td>\n";
-                    $html .= "  <td>".strftime("%c", $row['timestamp_in'])."</td>\n";
+                    $html .= "  <td>".strftime("%Y-%m-%d %H:%M:%S", strtotime($row['timestamp_in']))."</td>\n";
                     $html .= "  <td>";
                     if (!empty ($row['time_spent']))

Change History

Changed 15 years ago by benoitg

The patch would cause the time to no longer be displayed in the format specified by the current locale. Furthermore, a lot of people don't have problems. I've added output to help debug this. If you update to latest SVN and go to Server administration/Server access control, you will see what PHP and postgres think is the current timezone.

Changed 14 years ago by drazzib

  • status changed from new to closed
  • resolution set to duplicate

Same as #363.

Note: See TracTickets for help on using tickets.