Home > Enterprise >  Powershell Get-Date formate year from 2023 to 23
Powershell Get-Date formate year from 2023 to 23

Time:01-22

Do you know how i could format get-date so that the end result look like the below example

22 Jan 23

Instead of 22 Jan 2023

I got as far as get-date -Uformat "%d %B %Y"

Any help would be massively appreciated.

CodePudding user response:

get-date -UFormat "%d %b %y"

This will output the date in the format "dd MMM yy", for example "22 Jan 23". Note that %b is used to represent the month abbreviation instead of %B which is used to represent the full month name.

The command to display the full year using the date command is %Y.

date  %Y
  • Related