M
Michael R. Copeland
I need to determine a given date's week number, but my searches of
google only confuse and frustrate me: there are many apparent formulas
(which are pretty complex) and they all seem to require several
supporting libraries or subprograms. It doesn't seem to be all that
complex, so I assume I'm getting the wrong "hits" on my searches.
I have year (ccyy), month, and day, and I can derive the ordinal year
(yyddd) without difficulty, but I'm looking for a bit of C or C++ code
that will take either and return a value of 1-53 for the week in which
that date falls. Any thoughts? TIA
google only confuse and frustrate me: there are many apparent formulas
(which are pretty complex) and they all seem to require several
supporting libraries or subprograms. It doesn't seem to be all that
complex, so I assume I'm getting the wrong "hits" on my searches.
I have year (ccyy), month, and day, and I can derive the ordinal year
(yyddd) without difficulty, but I'm looking for a bit of C or C++ code
that will take either and return a value of 1-53 for the week in which
that date falls. Any thoughts? TIA