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