Getting Short Dates

Objects contain useful methods to access the object data. For example, DateTime objects support methods to display the date and time in various formats.

Use this if you just need a short date:

(Get-Date).toShortDateString()

Use this to see all methods available:

Get-Date | Get-Member -MemberType *method

Twitter This Tip! ReTweet this Tip!


Posted Sep 14 2010, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.