TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
 Specialized Dev Zones Research Center eBook Library .NET Java C++ Web Dev Architecture Database Security Open Source Enterprise Mobile Special Reports 10-Minute Solutions DevXtra Blogs Slideshow

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Language: Pascal
Expertise: Beginner
Jun 15, 1998

### WEBINAR:On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning

# Computing Number of the Week

Question:
I want to compute the number of the week.

PLM

This is pretty basic stuff. If you want the current week of the month, a simple function will do the trick:

```function GetWeekOfMonth(Day : Integer) : Integer;
begin
if (Day >= 1) AND (Day <= 7) then
Result := 1;
if (Day >= 8) AND (Day <= 14) then
Result := 2;
if (Day >= 15) AND (Day <= 21) then
Result := 3;
if (Day >= 22) AND (Day <= 28) then
Result := 4;
if (Day > 29) then
Result := 5;
end;
```
DevX Pro

 Submit a Tip Browse "Delphi And Pascal" Tips Browse All Tips
Comment and Contribute

(Maximum characters: 1200). You have 1200 characters left.

Thanks for your registration, follow us on our social networks to keep up-to-date