I have taken out irrelevant code for my question and left in what is relevant for my problem. It is stating that the Integer is too large. I have converted the current time to Milliseconds and I am trying to add a month, 2 weeks and 1 week in milliseconds to achieve the 'Date Expired'. If anyone knows how I would go about using Long instead of int? I'm confused as my Date isn't delclared as an Integer?
It is stating the error at 'dateExpired = dateExpired + 2628000000;'.
public class VIP implements Serializable {
private Date dateExpired;
public VIP(Date dateExpired) {
this.dateExpired = new Date(Calendar.getInstance().getTimeInMillis());
}
public Date getDateExpired() {
return dateExpired;
}
public void setDateExpired(String ticketType) {
if (ticketType.equals("Gold")) {
dateExpired = dateExpired + 2628000000;
} else if (ticketType.equals("Silver")) {
dateExpired = dateExpired + 1209600000;
} else {
dateExpired = dateExpired + 604800000;
}
}
}