-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix starttime and endtime timezone issues
- Loading branch information
Showing
7 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function ConvertTo-ReportTimeUTC { | ||
# Helper function that takes two DateTime objects (StartTime and EndTime) and | ||
# standardizes to UTC before returning a comma-separated string of the values | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[datetime]$StartTime, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[datetime]$EndTime | ||
) | ||
|
||
begin { } | ||
|
||
process { | ||
# try to set datetime object to a string the API will like | ||
$StrStart = $StartTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") | ||
$StrEnd = $EndTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") | ||
$ReportTime = "$StrStart,$StrEnd" | ||
|
||
Write-Verbose "Formatting time boundaries. ReportTime set to $ReportTime" | ||
Write-Output $ReportTime | ||
} | ||
|
||
end { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters