Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * Return current timestamp with format "yyyyMMddHHmmss". */ public static String getTimestamp() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.CHINA); return dateFormat.format(new Date()); } }