Problem constructing java.util.Date object
Posted on 2008-11-20
I'm trying to construct a java.util.Date object to be a date very far in the future but I'm having problems.
To construct the date 01/01/3000 I tried the following:
new Date (86400 * 365 * 1030)
that is, the number of seconds in a day * the number of days in a year * the number of years (3000 - 1970 = 1030) but this gives me the date 21/10/1969. I thought that the Date constructor allowed you to construct a date by supplying the number of milliseconds elapsed since 01/01/1970 but this doesn't seem to work. Can anyone help?