How do I calculate the week number given a date?
Posted
by GH
on Stack Overflow
See other posts from Stack Overflow
or by GH
Published on 2008-11-08T16:02:59Z
Indexed on
2010/05/11
21:04 UTC
Read the original article
Hit count: 297
If I have a date, how do I calculate the week number for that date within that year?
For example, in 2008, January 1st to January 6th are in week 1 and January 7th to the 13th are in week 2, so if my date was January 10th 2008, my week number would be 2.
An algorithm would be great to get me started and sample code would also help - I'm developing in C++ on Windows.
Related:
© Stack Overflow or respective owner