File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,37 +91,6 @@ function ParseErrorForResponseBody($Error) {
9191 }
9292}
9393
94- # helper function to convert datetime to unix timestamp
95- function ConvertTo-UnixTimestamp {
96- [CmdletBinding()]
97-
98- PARAM (
99- [parameter(Mandatory = $True,
100- Position = 0,
101- ValueFromPipeline = $True,
102- ValueFromPipelineByPropertyName = $True,
103- HelpMessage = "Date to be converted.")][DateTime[]]$Date,
104- [parameter(Mandatory = $True,
105- Position = 1,
106- ValueFromPipeline = $True,
107- ValueFromPipelineByPropertyName = $True,
108- HelpMessage = "Unit of timestamp.")][ValidateSet("Seconds", "Milliseconds")][String]$Unit = "Milliseconds"
109- )
110-
111- BEGIN {
112- $epoch = Get-Date -Year 1970 -Month 1 -Day 1 -Hour 0 -Minute 0 -Second 0
113- }
114-
115- PROCESS {
116- if ($Unit = "Seconds") {
117- Write-Output ([math]::truncate($Date.ToUniversalTime().Subtract($epoch).TotalSeconds))
118- }
119- else {
120- Write-Output ([math]::truncate($Date.ToUniversalTime().Subtract($epoch).TotalMilliSeconds))
121- }
122- }
123- }
124-
12594# helper function to convert unix timestamp to datetime
12695function ConvertFrom-UnixTimestamp {
12796 [CmdletBinding()]
You can’t perform that action at this time.
0 commit comments