PowerTip: Use PowerShell to Find the Number of Seconds in Three Days

PowerTip: Use PowerShell to Find the Number of Seconds in Three Days

  • Comments 1
  • Likes

Summary: Use Windows PowerShell to easily find the number of seconds in three days.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find how many seconds are in three days without diving into a bunch of multiplication or division?

Hey, Scripting Guy! Answer Use the New-TimeSpan cmdlet to create a time span of three days, and select the TotalSeconds property:

PS C:\> (New-TimeSpan -Days 3).totalseconds

259200 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Thank you.