mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Added function to convert seconds to runtime
This commit is contained in:
parent
5791dbeddd
commit
c6ae93cb7b
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