Skip to content

Commit

Permalink
local time
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmeszaros committed Oct 5, 2018
1 parent 6b23102 commit 0248308
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions web/minerHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,9 @@ public static function checkWallet($coin_seo_name = FALSE) {
if (!empty($_COOKIE['userLocalTimeZone'])) {
$time_zone = json_decode($_COOKIE['userLocalTimeZone'], true);
// Make sure there's an available abbreviation before setting the timezone
if (timezone_name_from_abbr( '', ($time_zone['offset'] + 60) * 60, $time_zone['dst'])) {
date_default_timezone_set( timezone_name_from_abbr('', ($time_zone['offset'] + 60) * 60, $time_zone['dst']));

if (timezone_name_from_abbr( '', ($time_zone['offset'] - 60) * 60, $time_zone['dst'])) {
date_default_timezone_set( timezone_name_from_abbr('', ($time_zone['offset'] - 60) * 60, $time_zone['dst']));
}
}

Expand Down
2 changes: 1 addition & 1 deletion web/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
function setTimeOffset() {
// Create all the dates necessary
var now = later = d1 = d2 = new Date(),
set = { 'offset': now.getTimezoneOffset(), 'dst': 0 }
set = { 'offset': now.getTimezoneOffset() * -1, 'dst': 0 }
// Set time for how long the cookie should be saved - 1 year
later.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
// Date one is set to January 1st of this year
Expand Down

0 comments on commit 0248308

Please sign in to comment.