mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Added function to convert seconds to runtime
This commit is contained in:
parent
7890b69e4c
commit
a978a64c59
1 changed files with 18 additions and 0 deletions
18
lib/core/tools/ConvertFrom-TimeSpan.psm1
Normal file
18
lib/core/tools/ConvertFrom-TimeSpan.psm1
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Import-IcingaLib core\tools;
|
||||
|
||||
function ConvertFrom-TimeSpan()
|
||||
{
|
||||
param(
|
||||
$Seconds
|
||||
);
|
||||
|
||||
$TimeSpan = [TimeSpan]::FromSeconds($Seconds);
|
||||
|
||||
return [string]::Format(
|
||||
'Days: {0} Hours: {1} Minutes: {2} Seconds: {3}',
|
||||
$TimeSpan.Days,
|
||||
$TimeSpan.Hours,
|
||||
$TimeSpan.Minutes,
|
||||
$TimeSpan.Seconds
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue