menembus batas impian


DateFormat df = new SimpleDateFormat(“dd-MM-yyyy”);
Date TanggalPinjam =df.parse(tglcair.getText());
long Hari1 = TanggalPinjam.getTime();
int diff=(int)Double.parseDouble( fjangka.getText());
Calendar cal = Calendar.getInstance();
cal.setTime(TanggalPinjam);

1. Menambahkan 1 Hari
cal.add(Calendar.DAY_OF_MONTH, diff);

2. Menambahkan 1 Minggu
cal.add(Calendar.WEEK_OF_MONTH, diff);

3. Menambahkan 1 Bulan
cal.add(Calendar.MONTH, diff);

4. Menambahkan 1 Tahun
cal.add(Calendar.YEAR, diff);

Date d=cal.getTime();
System.out.println(d);
tgltempo.setValue(d);

nuwun

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: