Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Powershell Get-Date formate year from 2023 to 23

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

Any help would be massively appreciated.

>Solution :

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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading