Skip to content

Commit

Permalink
Merge pull request #2111 from pi-hole/local_time
Browse files Browse the repository at this point in the history
Include timezone info in time/date FTL has been started
  • Loading branch information
DL6ER authored Feb 12, 2022
2 parents f4c765a + bfe91d9 commit d9ad678
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
$error .= "There was a problem applying your settings.<br>Debugging information:<br>PHP error (".htmlspecialchars($last_error["type"])."): ".htmlspecialchars($last_error["message"])." in ".htmlspecialchars($last_error["file"]).":".htmlspecialchars($last_error["line"]);
}

# Timezone is set in docker via ENV otherwise get it from commandline
$timezone=htmlspecialchars(getenv("TZ"));
if (empty($timezone)) {
$timezone=shell_exec("date +'%Z'");
}

?>
<style>
.tooltip-inner {
Expand Down Expand Up @@ -253,7 +259,7 @@ function get_FTL_data($arg)
</tr>
<tr>
<th scope="row">Time FTL started:</th>
<td><?php print_r(get_FTL_data("lstart")); ?></td>
<td><?php print_r(get_FTL_data("lstart")); echo " ".$timezone; ?></td>
</tr>
<tr>
<th scope="row">User / Group:</th>
Expand Down

0 comments on commit d9ad678

Please sign in to comment.