반응형
- 날짜
# 현재 날짜
Get-Date
# 현재 날짜 (포맷)
Get-Date -Uformat "%Y-%m-%d %H:%M"
# 날짜 변경 (포맷)
Get-Date -Uformat "%Y-%m-%d %H:%M" -Year 1999 -Hour 19
# 일자로 계산
(Get-Date -Year 2010 -Month 12 -Day 31).DayOfYear
# 요일
(Get-Date -Year 2010 -Month 12 -Day 31).DayOfWeek
# 날짜 +- 계산 (AddDays / AddMonths / AddYears)
(Get-Date -Year 2011 -Month 12 -Day 31).adddays(1)
Get-Date (Microsoft.PowerShell.Utility)
The Get-Date cmdlet gets a DateTime object that represents the current date or a date that you specify. It can format the date and time in several Windows and UNIX formats. You can use Get-Date to generate a date or time character string, and then send the
docs.microsoft.com
반응형
'Windows 10 > PowerShell' 카테고리의 다른 글
PowerShell : Alias (0) | 2019.06.15 |
---|---|
PowerShell : 특수문자 (0) | 2019.06.15 |
PowerShell : IEX (문자열을 명령어로 실행하기) (0) | 2019.06.15 |
PowerShell : 기초 명령어 (복사, 삭제, 이동) (0) | 2019.06.14 |
PowerSehll : Try, Catch, Finally (예외 처리) (0) | 2019.06.14 |