PowerTip: Get Time with PowerShell


Summary: Use Windows PowerShell to get the current time.

Hey, Scripting Guy! Question How can I use Windows PowerShell to get the current time?

Hey, Scripting Guy! Answer Use the Get-Date cmdlet and specify a –DisplayHint of Time:

Get-Date -DisplayHint time

Comments (2)

  1. Kirill Pashkov says:

    Now that’s a news for me. I was playing around with ‘-Format HH:mm:ss’ for like years now. And there was such a way. Thanks!

  2. HicanNL says:

    Well, this is a nice feature, but -Format still brings a ton more flexibility. So I still prefer to use that 🙂

Skip to main content