Here you can find the source of getCurrentTimestamp()
public static String getCurrentTimestamp()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /**/*from www . j a v a 2 s . com*/ * Get current time include time zone to save to DB * * @return time string */ public static String getCurrentTimestamp() { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar .getInstance().getTime()); } }