WeekOfMonth

Line Break

Author: Martin Zugec (31 Articles)

Today I needed small function to determine what is the number of current week (usually referred as WeekOfMonth).

Code is very simple in fact:

Function Get-WeekOfMonth ([datetime]$Date = $(Get-Date)) {
	[int]$Day = $Date.Day
	Return [math]::Ceiling($Day / 7)
}

 

Martin

Bookmark and Share
Tags »

Author:Martin Zugec
Date: Tuesday, 9. March 2010 19:05
Trackback: Trackback-URL Category: General, PowerShell, Scripting, Windows PowerShell

Feed for the post RSS 2.0 Comment this post

Submit comment

CAPTCHA Image CAPTCHA Audio
Refresh Image