Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##################################################################################################
- 0,4 | ForEach { If ($args[$_] -eq "C") {$Span[$_] = New-TimeSpan -End (Get-Date)}
- If ($_ -eq 0) {$o = 1} Else {$o = 0}
- $Span[$o] = New-TimeSpan -End (Get-Date -Year $args[$o] -Month $args[($o+1)] -Day $args[($o+2)])
- $D = $True
- }
- If (!$D) {
- $Span[0] = New-TimeSpan -End (Get-Date -Year $args[0] -Month $args[1] -Day $args[2])
- $Span[1] = New-TimeSpan -End (Get-Date -Year $args[3] -Month $args[4] -Day $args[5])
- }
- $Diff = $Span[1]-$Span[0]
- Write-Host "Difference of $($Span[1]) and $($Span[2]) in days is $($Diff.Days) Days."
- ##################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement