Skip to content

Commit 37c3da1

Browse files
committed
Removed unused ConvertTo-UnixTimestamp helper Cmdlet
1 parent 16cbac9 commit 37c3da1

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff 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
12695
function ConvertFrom-UnixTimestamp {
12796
[CmdletBinding()]

0 commit comments

Comments
 (0)