Skip to content

Commit

Permalink
Merge pull request #44 from pi-hole/GMTisnttheworld
Browse files Browse the repository at this point in the history
Remove references to GMT. Causing issues for international users
  • Loading branch information
PromoFaux committed Feb 23, 2016
2 parents d143334 + 1477a1e commit 1584e44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function getAllQueries() {
$dns_queries = getDnsQueries($log);

foreach ($dns_queries as $query) {
$time = date_create(substr($query, 0, 16), new DateTimeZone('GMT'))->SetTimeZone(new DateTimeZone(date_default_timezone_get()));
$time = date_create(substr($query, 0, 16));

$exploded = explode(" ", trim($query));
array_push($allQueries['data'], array(
Expand Down Expand Up @@ -180,7 +180,7 @@ function topItems($queries, $exclude = array(), $qty=10) {
function overTime($entries) {
$byTime = array();
foreach ($entries as $entry) {
$time = date_create(substr($entry, 0, 16), new DateTimeZone('GMT'))->SetTimeZone(new DateTimeZone(date_default_timezone_get()));
$time = date_create(substr($entry, 0, 16));
$hour = $time->format('G');

if (isset($byTime[$hour])) {
Expand Down Expand Up @@ -215,7 +215,7 @@ function getRecent($queries, $qty){
foreach (array_slice($queries, -$qty) as $query) {
$queryArray = array();
$exploded = explode(" ", $query);
$time = date_create(substr($query, 0, 16), new DateTimeZone('GMT'))->SetTimeZone(new DateTimeZone(date_default_timezone_get()));
$time = date_create(substr($query, 0, 16));
$queryArray['time'] = $time->format('h:i:s a');
$queryArray['domain'] = trim($exploded[count($exploded) - 3]);
$queryArray['ip'] = trim($exploded[count($exploded)-1]);
Expand Down

0 comments on commit 1584e44

Please sign in to comment.