Calculate Difference/Duration between Two Timestamps in PowerShell
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 2 years ago
copyright
This page is subject to Site terms.
comment Comments
No comments yet.
Log in with external accounts
warning Please login first to view stats information.
code
Deploy Azure Automation Runbooks via GitHub Actions
article
List all environment variables in PowerShell
article
Azure PowerShell Runbook Error - Internet Explorer engine is not available
article
Github Action Az Automation PowerShell: Object reference not set to an instance of an object
article
Calculate Time Difference between Dates in PowerShell
Read more (8)