Android Calendar Set moveToDate(int field, int amount)

Here you can find the source of moveToDate(int field, int amount)

Description

move To Date

Declaration

public static Date moveToDate(int field, int amount) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date moveToDate(int field, int amount) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.add(field, amount);//from ww  w  .j av  a 2 s . c o m
        return calendar.getTime();
    }
}

Related

  1. prepareCalendar(int hourOfDay, int minute)
  2. toDateTime(Calendar calendar)
  3. stripTime(Calendar cal)
  4. setDate(Calendar cal, long date)
  5. setTime(Calendar cal, long time)