- Basic Usage
- Get-Date returns current system date and time by default
- Command can display only current date/time using DisplayHint parameter
- Dates can be retrieved from future/past using -day, -month, -year parameters
- Formatting
- Dates can be formatted using .Net format or UFormat specifiers
- Both formats return string objects, not date objects
- Formatting options include date, time, and DateTime components
- Date Manipulation
- Add/subtract days using AddDays method with positive/negative numbers
- Multiple date calculations possible using various Add methods
- Dates can be compared using PowerShell comparison operators
- Advanced Features
- Strings can be converted to DateTime objects using casting
- New-TimeSpan cmdlet calculates days between two dates
- PowerShell makes date manipulation straightforward and efficient