I want to get the current timestamp like that : 1320917972
int time = (int) (System.currentTimeMillis()); Timestamp tsTemp = new Timestamp(t
It's simple use:
long millis = new Date().getTime();
if you want it in particular format then you need Formatter like below
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String millisInString = dateFormat.format(new Date());