Skip to content

Commit

Permalink
Update date parser format
Browse files Browse the repository at this point in the history
Signed-off-by: bhumitra nagar <[email protected]>
  • Loading branch information
bhumitra authored Mar 28, 2023
1 parent d4a2888 commit d0f13ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion VMware.CloudFoundation.Reporting.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ Function Publish-CertificateHealth {
$elementObject | Add-Member -NotePropertyName 'Resource' -NotePropertyValue ($element.area -Split (':'))[-1].Trim()
if ($element.title -and $element.title -notcontains "-") {
$current = [DateTime]::Now
$expiry = [DateTime]::ParseExact($element.title[2], "MMM dd HH:mm:ss yyyy 'GMT'", $null).ToUniversalTime()
$expiry = [DateTime]::ParseExact(($element.title[2] -replace '\s+', ' '), "MMM d HH:mm:ss yyyy 'GMT'", $null).ToUniversalTime()
$expires_in = ($expiry - $current).Days
$alert = "GREEN"
if ([int]$expires_in -le 15) {
Expand Down

0 comments on commit d0f13ad

Please sign in to comment.