Here you can find the source of getTimeInEpoch(int offSetInMinutes)
public static long getTimeInEpoch(int offSetInMinutes)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static long getTimeInEpoch(int offSetInMinutes) { //DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); Date dNow = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(dNow);//w w w.j ava 2 s.c om calendar.add(Calendar.MINUTE, offSetInMinutes); return calendar.getTimeInMillis() / 1000; } }