Fun with Date and Time

by Mar 22, 2012

Get-Date can extract valuable information from dates. All you need to know is the placeholder for the date part you are after. Then, repeat that placeholder to see different representations. For example, an upper-case "M" represents the month part:

PS> Get-Date -format 'M'
March 02
PS> Get-Date -format 'MM'
PS> Get-Date -format 'MMM'
PS> Get-Date -format 'MMMM'

Twitter This Tip! ReTweet this Tip!