Here you can find the source of before(Calendar c, long offset)
public static Calendar before(Calendar c, long offset)
//package com.java2s; import java.util.Calendar; public class Main { public static Calendar before(Calendar c, long offset) { Calendar calendar = null; if (c != null) { calendar = c;//from ww w. j a v a 2 s. c om } else { calendar = Calendar.getInstance(); } calendar.setTimeInMillis(calendar.getTimeInMillis() - offset); return calendar; } }