Skip to content

Commit d6a3dd6

Browse files
committed
Update .NET v4 cloudwatch tests to handle positive timezone offsets.
1 parent 9bdcdbb commit d6a3dd6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dotnetv4/CloudWatch/Actions/CloudWatchWrapper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ public async Task<List<MetricDataResult>> GetMetricData(int minutesOfData, bool
243243
var startTimeUtc = endDateUtc.Value.AddMinutes(-minutesOfData);
244244
// The timezone string should be in the format +0000, so use the timezone offset to format it correctly.
245245
var timeZoneString = $"{timeZoneOffset.Hours:D2}{timeZoneOffset.Minutes:D2}";
246+
// Add the plus sign for positive offsets.
247+
timeZoneString = timeZoneString.StartsWith('-') ? timeZoneString : "+" + timeZoneString;
246248
var paginatedMetricData = _amazonCloudWatch.Paginators.GetMetricData(
247249
new GetMetricDataRequest()
248250
{

0 commit comments

Comments
 (0)