NB: yes I realize that using simple date format may well be better than my current system, but I find this easier than using simple date format.
This code should simply return the date saved as dd/mm/yyyy, and it does so for the loan date 1/1/2013, however for the dueBack date it returns 22/4/2013, it should be returning 22/1/2013.
public String returnLoan()
{
String dLoan = loan.get(loan.DAY_OF_MONTH) + "/"
+ loan.get(loan.MONTH + 1) + "/"
+ loan.get(loan.YEAR);
return dLoan;
}
public String returnDueBack()
{
String dDueBack = dueBack.get(dueBack.DAY_OF_MONTH) + "/"
+ dueBack.get(dueBack.MONTH + 1) + "/"
+ dueBack.get(dueBack.YEAR);
return dDueBack;
}
for reference this is the constructor
public Loan()
{
memID = 0;
bookID = 0;
loan = new GregorianCalendar(2013, 0, 1);
dueBack = new GregorianCalendar(2013, 0, 22);
returned = false;
}
Any help is greatly appreciated.