Android Date Interval Get offsetSecond(Date date, int offset)

Here you can find the source of offsetSecond(Date date, int offset)

Description

offset Second

Declaration

public static Date offsetSecond(Date date, int offset) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static Date offsetSecond(Date date, int offset) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);//  w w w  .  j  ava 2  s .  co  m
        calendar.set(Calendar.SECOND,
                (calendar.get(Calendar.SECOND) + offset));
        return calendar.getTime();
    }
}

Related

  1. millisecondsBetween(Date dt1, Date dt2)
  2. minuteBetweenDate(Date date1, Date date2)
  3. minutesBetween(Date dt1, Date dt2)
  4. minutesBetween(Date dt1, Date dt2)
  5. offsetMinute(Date date, int offset)
  6. secondBetweenDate(Date date1, Date date2)
  7. secondDiff(Date date1, Date date2)
  8. secondDiff(String startTime, String endTime)
  9. secondsBetween(Date dt1, Date dt2)