PowerTip: Find How Many Days until PowerShell Summit Europe 2014

Summary: Use Windows PowerShell to find how many days until Windows PowerShell Summit Europe in Amsterdam.

Hey, Scripting Guy! Question How can I use Windows PowerShell to help me find how many days until the Windows PowerShell Summit
           Europe 2014 in Amsterdam?

Hey, Scripting Guy! Answer Use the New-TimeSpan cmdlet, and use Get-Date to specify the start time and Sept. 29, 2014 as the end time:

New-TimeSpan -Start (get-date) -End 9/29/14

Comments (5)

  1. Or ((get-date -Day 29 -month 9 -Year 2014) – (Get-date)).days

  2. Mark Rogers says:

    But make sure the date format for the cmdlet matches your machine’s date format setting.

  3. Ed Wilson says:

    @Claudio Westerik I like your solution. Nice.
    @Mark Rogers this is true, you must match your machine formatting of the date. This is one advantage of Claudio’s solution, it will create the date as required using your datetime format setting.

  4. tony says:

    Yes, date format is important given that Europe is day/month/year. 😉

Skip to main content