Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static String getNowTimeString() { SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd_hhmmss"); return sDateFormat.format(new java.util.Date()); } }