So i have a startDate in my java class that gets set as the current time, i also have minutes variable which is the length of time i would like to add onto the startDate in order to create an endDate.
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
private Date startTime;
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
private Date endTime;
private int minutes;
public void setEndDate{
}
I have a getTime method which is used to set the startTime:
Date getTime() {
Timestamp time = new Timestamp(new Date().getTime());
return time;
}
How would i go about creating a method to set the end date based on the startDate with minutes added on?
Thanks in advance.