# Gets the minimum date (usually used to do date calculations) Get-date 0# Gets the current date get-date# gets the current date of the year (get-date). Year# gets the month of the current date (get-date). Month# gets the day of the current date (get-date). Day# gets the number of days from this year (get-date). Dayofyear# Gets the week (get-date). DayOfWeek # The first day of the Year (Get-date 0). AddYears ((get-date). YEAR-1) # The last day of the year (Get-date 0). AddYears ((get-date). Year). AddDays (-1) # The first day of the month (Get-date 0). AddYears ((get-date). YEAR-1). AddMonths ((get-date). MONTH-1) # The last day of the month (Get-date 0). AddYears ((get-date). YEAR-1). AddMonths ((get-date). Month). AddDays (-1) # The first day of the month (Get-date 0). AddYears ((get-date). YEAR-1). AddMonths ((get-date). MONTH-2) # Last day of the month (Get-date 0). AddYears ((get-date). YEAR-1). AddMonths ((get-date). MONTH-1). AddDays (-1) # The first day of the week (Get-date 0). AddYears ((get-date). YEAR-1). AddDays (((Get-date-uformat%V)-1) * 7) # The last day of the week (Get-date 0). AddYears ((get-date). YEAR-1). AddDays ([int] (Get-date-uformat%V) * 7). AddDays (-1) #:00 (Get-date-hour 0-minute 0-second 0)
Common date Calculations