In short, what I am trying to do is, based on a date, calculate the week of
year (as described in ISO 8601), then calculate the first and last date in
this week period and return them in the format CCYYMMDD. Sounds easy
enough, right??
I am attempting to accomplish this by creating a GregorianCalend er which
will get me the week of year. Then by changing the day of week to 1 (start
of week) i'm trying the get the first day of the week, and day_of_week = 7
should get me the last. Maybe?
I think I may have successfully done this by using an instance of the
GregorianCalend ar with the no argument constructor, which appears to
default to the current system date/time. However, when I attempt to do the
same with the GregorianCalend ar(int year, int month, int date) constructor,
it does not work. It seems that my attemps to set the DAY_OF_WEEK value
have no effect?
Some code samples below,
Thanks for any help you can offer...
Carl.
year (as described in ISO 8601), then calculate the first and last date in
this week period and return them in the format CCYYMMDD. Sounds easy
enough, right??
I am attempting to accomplish this by creating a GregorianCalend er which
will get me the week of year. Then by changing the day of week to 1 (start
of week) i'm trying the get the first day of the week, and day_of_week = 7
should get me the last. Maybe?
I think I may have successfully done this by using an instance of the
GregorianCalend ar with the no argument constructor, which appears to
default to the current system date/time. However, when I attempt to do the
same with the GregorianCalend ar(int year, int month, int date) constructor,
it does not work. It seems that my attemps to set the DAY_OF_WEEK value
have no effect?
Some code samples below,
Thanks for any help you can offer...
Carl.
Comment