Java tutorial
//package com.java2s; import java.sql.Date; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public static String getTimeStamp_1() { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss", Locale.US); Date curDate = new Date(System.currentTimeMillis()); return formatter.format(curDate); } }