これが私のコードです
public java.util.Date getDelDate() {
Date m=new Date();
System.out.println("ticket date "+ m);
double d;
d=(multiply/consumption);
int days= (int) d;
System.out.println("del days "+ days);
m.setTime(m.getTime() + days * 1000 * 60 * 60 * 24);
System.out.println(m+"Delivery date");
return m;
}
public java.util.Date getRemDate() {
Date m1=new Date();
double d;
d=(multiply/consumption);
int days= (int) d-2;
System.out.println("rem days "+ days);
m1.setTime(m1.getTime() + days * 1000 * 60 * 60 * 24);
System.out.println(m1+"Remember date");
return m1;
//return remdate;
}
の入力値multiply = 21
とconsumption = 2
出力は (次のように正しい)
ticket date Wed Oct 02 21:43:56 IST 2013
del days 10
Sat Oct 12 21:43:56 IST 2013Delivery date
rem days 8
の入力値multiply = 35
とconsumption = 1
出力は(古い日付を示す次のように間違っています)
ticket date Wed Oct 02 21:52:07 IST 2013
del days 35
Wed Sep 18 04:49:20 IST 2013Delivery date
rem days 33
Mon Sep 16 04:49:20 IST 2013Remember date
の入力値multiply = 1
とconsumption = 0.03
出力は(古い日付を示す次のように間違っています)
ticket date Wed Oct 02 21:26:56 IST 2013
del days 33
Mon Sep 16 04:24:09 IST 2013Delivery date //date here is sept?
rem days 31
Sat Sep 14 04:24:09 IST 2013Remember date
正しい日付を計算するにはどうすればよいですか?