Java tutorial
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; public class Main { public static String getJoinedSysDateTime() { String str = getSysDateTime(); str = str.substring(0, 4) + str.substring(5, 7) + str.substring(8, 10) + str.substring(11, 13) + str.substring(14, 16) + str.substring(17, 19); return str; } public static String getSysDateTime() { return new Timestamp(System.currentTimeMillis()).toString().substring(0, 19); } }