Java Calendar Add addSeconds(Calendar calendar, int amount)

Here you can find the source of addSeconds(Calendar calendar, int amount)

Description

add Seconds

License

Apache License

Declaration

static public Calendar addSeconds(Calendar calendar, int amount) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {
    static public Calendar addSeconds(Calendar calendar, int amount) {
        return add(calendar, Calendar.SECOND, amount);
    }/*from  www.jav a 2 s  .  c om*/

    static public Calendar add(Calendar calendar, int calendarField, int amount) {
        Calendar c = Calendar.getInstance();
        c.setTime(calendar.getTime());
        c.add(calendarField, amount);
        return c;
    }
}

Related

  1. addDayToCalendar(Calendar calendar, int day)
  2. addLocaleToCalendar(Calendar date, String locale)
  3. addMilliseconds(Calendar calendar, Long amount)
  4. addMonth(Calendar cal, int period)
  5. addMonthDayToCal(Calendar cal, int month, int day)
  6. addToUTCMilliSeconds(int calendarTime, int actualValue)
  7. addWeekdays(Calendar cal, int days)
  8. addWorkdays(final Calendar calendar, final int dauer)
  9. appendDate(StringBuffer buf, Calendar cal)