Skip to main content

[Powershell]: Get-Date and commonly used date format

Get-Date and commonly used date format in powershell


PS C:\Users\Administrator> get-date
Thursday, June 25, 2015 9:42:24 AM

PS C:\Users\Administrator> $today = get-date
PS C:\Users\Administrator> echo $today

Thursday, June 25, 2015 9:43:21 AM

PS C:\Users\Administrator> $todayshort = get-date -format yyMMdd
PS C:\Users\Administrator> echo $todayshort
150625

PS C:\Users\Administrator> $todaylong = get-date -format yyyyMMdd
PS C:\Users\Administrator> echo $todaylong
20150625

PS C:\Users\Administrator>

Popular posts from this blog

IIS: Delete cached files on server running IIS

Delete cached files on server running IIS When changing css, javascript files, check to delete if IIS still caches old files in the default folder C:\inetpub\temp\IIS Temporary Compressed Files\<sitename>\$^_gzip_D^\ Apply to: IIS 8.5

Linux command: du - disk usage

Where have all my storage gone? du summarize disk usage of the set of FILEs, recursively for directories.

ManageEngine ServiceDesk Plus - Reset password

Let's reset the default administrator's password to 'admin'