Determine the Day of the Week in 11 Days from Now with PowerShell
A couple of days ago, one of my kids asked me "What day of the week will it be in 11 days from
now?". My response was "I'm not sure, but I can tell you how to figure out the answer for
yourself". Open up PowerShell, wrap
Get-Date in
parentheses, place a dot or period afterwards, followed by AddDays
, then 11 in another set of
parentheses, and finally another dot or period followed by DayOfWeek
.
1(Get-Date).AddDays(11).DayOfWeek
Want to know what the day of the week was 11 days ago instead? Simply use negative 11 (-11) which
subtracts that number of days from the current datetime
instead of adding it as shown in the
previous example.
µ