Skip to content

Commit

Permalink
[#5172] Health check time is always in the Pacific timezone (#6933)
Browse files Browse the repository at this point in the history
* Fix timezone issue

* Changed moment timezone to moment
  • Loading branch information
jaydeepkumara authored Jan 22, 2021
1 parent 8ed5f8d commit edfe17b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion managed/devops/bin/cluster_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def seconds_to_human_readable_time(seconds):


def local_time():
return datetime.utcnow().replace(tzinfo=tz.tzutc()).astimezone(tz.gettz('America/Los_Angeles'))
return datetime.utcnow().replace(tzinfo=tz.tzutc())


###################################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, { Component } from 'react';
import { Alert, Row } from 'react-bootstrap';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import * as moment from 'moment';
import moment from 'moment';
import { sortBy, values } from 'lodash';

import { YBLoading } from '../../../common/indicators';
Expand Down Expand Up @@ -225,7 +225,7 @@ const detailsFormatter = (cell, row) => {
function prepareData(data) {
return data.map((timeDataJson) => {
const timeData = JSON.parse(timeDataJson);
const timestampMoment = moment(timeData.timestamp);
const timestampMoment = moment.utc(timeData.timestamp).local();
const nodesByIpAddress = {};
timeData.data.forEach((check) => {
check.key = getKeyForCheck(check);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class HealthInfoPanel extends PureComponent {
let disabledUntilStr = '';
if (getPromiseState(healthCheck).isSuccess()) {
const healthCheckData = JSON.parse([...healthCheck.data].reverse()[0]);
const lastUpdateDate = moment(healthCheckData.timestamp);
const lastUpdateDate = moment.utc(healthCheckData.timestamp).local();
if (universeInfo.universeConfig && 'disableAlertsUntilSecs' in universeInfo.universeConfig) {
const disabledUntilSecs = Number(universeInfo.universeConfig.disableAlertsUntilSecs);
const now = Date.now() / 1000;
Expand Down

0 comments on commit edfe17b

Please sign in to comment.