By using this site, you acknowledge that you have read and understand our Cookie policy, Privacy policy and Terms .

Code snippets for various programming languages/frameworks.

rss_feed Subscribe RSS
access_time 8 months ago comment 0 languageEnglish

This code snippet shows how to calculate time differences.

In PowerShell, you can use New-TimeSpan cmdlets to calculate the time differences between two dates/timestamps.

Code snippet

$current = Get-Date
$end= Get-Date
$diff= New-TimeSpan -Start $current -End $end
Write-Output "Time difference is: $diff"
info Last modified by Raymond at 8 months ago
info About author

info License/Terms

Please log in or register to comment. account_circle Log in person_add Register
comment Comments (0)
No comments yet.