PowerTip: Use PowerShell to get only the date


Summary: Learn how to find only the date by using the Get-Date cmdlet.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily display only the date (not the time)?

Hey, Scripting Guy! Answer Use the Get-Date cmdlet and specify a display hint of date, for example:

Get-Date -DisplayHint date

Comments (1)

  1. Stuart says:

    I like

    Get-Date -Format ddMMMyy

    I then can put that in a variable and add to my naming convention of files that I generate daily.

Skip to main content