Here you can find the source of getTimestamp(int offset)
public static String getTimestamp(int offset)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class Main { public static String getTimestamp(int offset) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.MINUTE, offset); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); formatter.setTimeZone(TimeZone.getTimeZone("GMT")); return formatter.format(cal.getTime()); }/*w w w .j ava 2s . co m*/ }