Here you can find the source of milliseconds(int offset)
public static Date milliseconds(int offset)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date milliseconds(int offset) { Calendar c = Calendar.getInstance(); c.set(Calendar.MILLISECOND, c.get(Calendar.MILLISECOND) + offset); return c.getTime(); }/* ww w. j av a 2 s.com*/ public static Date milliseconds(long offset) { return milliseconds((int) offset); } }