Angus Ferguson wrote:when I use this code:
...
In someDate.getDate(); I get 1970-01-01 01:00:00.
I am looking for the last week
Any idea?
Well first, you really should read the API documentation for java.util.Date and java.util.Calendar, because there's a lot to know.
For example:
What do you think
Calendar.DAY_OF_YEAR - 7 returns? And what
unit is it going to be in?
What does
Date.setDate() take?
Until you
understand what these methods do, you'll simply be floundering around in the dark; and that's no way to program.
Winston
PS: It's probably worth mentioning that
Date.setDate() is
deprecated, which you'd also know if you had read the documentation.