mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
14 lines
327 B
PowerShell
14 lines
327 B
PowerShell
function Get-IcingaUnixTime()
|
|
{
|
|
param(
|
|
[switch]$Milliseconds = $FALSE
|
|
);
|
|
|
|
if ($Milliseconds) {
|
|
return ([int64](([DateTime]::UtcNow) - (Get-Date '1/1/1970')).TotalMilliseconds / 1000);
|
|
}
|
|
|
|
return [int][double]::Parse(
|
|
(Get-Date -UFormat %s -Date (Get-Date).ToUniversalTime())
|
|
);
|
|
}
|