SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

String currentTime = df.format(System.currentTimeMillis());