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

GNS3: Notes

As usual, notes is for myself and might be useful and also save time for beginners start using GNS3 .

Debian: Install NASM - The Netwide Assembler

sudo apt install nasm Check NASM Version nasm -v Find out more about NASM at https://nasm.us/doc/nasmdoc0.html

Linux: compound commands

command1 ; command2 ; command3 command1 is executed, then command2, and then command3 command1 && command2 && command3 command2 is executed only if command1 run successfully (exit code is 0), command3 is executed only if command2 run successfully (exit code is 0) command1 || command2 || command3 command2 is executed only if command1 exit code is 0 (failure), command3 is executed only if command2 exit code is 0 (failure)