Here you can find the source of calculateTimestamp()
public static String calculateTimestamp()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); /**/* www .j av a 2s .co m*/ * This method is used to calculate the current timestamp of a request. * <p> * The format of the returned String is "yyyyMMddHHmmss". * * @return the current time as a String */ public static String calculateTimestamp() { Calendar cal = new GregorianCalendar(); sdf.setTimeZone(cal.getTimeZone()); return sdf.format(cal.getTime()); } }