diff --git a/lib/plugins/aws/metrics/awsMetrics.js b/lib/plugins/aws/metrics/awsMetrics.js index 6d0e29aa3..8899daf37 100644 --- a/lib/plugins/aws/metrics/awsMetrics.js +++ b/lib/plugins/aws/metrics/awsMetrics.js @@ -33,9 +33,7 @@ class AwsMetrics { this.validate(); const today = new Date(); - let yesterday = new Date(); - yesterday = yesterday.setDate(yesterday.getDate() - 1); - yesterday = new Date(yesterday); + const yesterday = moment().subtract(1, 'day').toDate(); if (this.options.startTime) { const since = (['m', 'h', 'd']