Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time issue on day_host #2

Closed
SirDMZ opened this issue Jun 28, 2014 · 1 comment
Closed

Time issue on day_host #2

SirDMZ opened this issue Jun 28, 2014 · 1 comment

Comments

@SirDMZ
Copy link

SirDMZ commented Jun 28, 2014

Greetings,
As seen with screenshot attachment, in some setups the assumed timezone data is wrong.
demo

Can be fixed by setting timezone. (Needs to be moved over to config file).
(See attached patch to fix only in day_host)

diff -Nur ./pmacct-frontend-master/day_host.php /var/www/html/pmacct/day_host.php
--- ./pmacct-frontend-master/day_host.php 2012-11-03 22:06:17.000000000 +1100
+++ /var/www/html/pmacct/day_host.php 2014-06-27 22:59:26.626283671 +1000
@@ -12,6 +12,8 @@
$day = !empty($_GET['day']) ? (int) $_GET['day'] : date('d');
$ip = $_GET['ip'];

+date_default_timezone_set('Australia/ACT');
+
$date = mktime(0, 0, 0, $month, $day, $year);

$data = Data_Host::day($ip, $date);
@@ -21,4 +23,4 @@
->set('date', $date)
->set('data', $data)
->render();
-?>
\ No newline at end of file
+?>

@Daniel15
Copy link
Owner

Daniel15 commented Jul 9, 2014

You should set the timezone in php.ini:

date.timezone = "Australia/ACT"

@Daniel15 Daniel15 closed this as completed Jul 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants