How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
$startDate = Get-Date "01/01/1901"
$endDate = Get-Date "12/31/2000"
$cnt = 0
for($date=$startDate; $date -lt $endDate; $date = $date.AddMonths(1))
{
if ($date.DayOfWeek -eq 'Sunday')
{
$cnt++
}
}
$cnt
1 comment:
Thank you so much for this post, it was very insightful!
Reverse Phone Lookup also contains hundreds of cell phone and telecommunications articles and resources covering all aspects of cell phone safety, security, accessories and shopping.
Phone Number Trace Reverse Phone Lookup, Unknown Number Search - welcome to reverse-phone-lookup-online.info visit More Reviews.
Post a Comment