Introduction
This is my first attempt ever to write an article of any kind. I don't have much experience in programming, but I would love some feedback about this article in order to learn. English is not my primary language, so be nice to me. :-)
Background
I'm currently working on a calendar application with a friend of mine, and knowing the weekday and the weeknumber is somehow fundamental. ;)
I can't remember where I found the algorithms and information necessary to know how to retrieve the weekday and weeknumber, but if you know, then contact me and I will give the person credits for it.
How to use CWeek
CWeek
is easy to use. First, declare an instance of the object.
CWeek date;
After this, you should set the date. For example, October 15, 2004.
date.setDate(2004,10,15);
To retrieve the weekday or the weeknumber, simply use:
nWeeknumber = date.getWeeknumber();
nWeekday = date.getWeekday();
History
- 23rd March, 2004: Initial version
License
This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.
A list of licenses authors might use can be found here.