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