Here you can find the source of getNowTime()
public static String getNowTime()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /**/*from www. jav a 2 s.com*/ * yyyy-MM-dd HH:mm:ss Comment for <code>allDateFmt</code> */ public static final SimpleDateFormat allDateFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA); /** * yyyy-MM-dd HH:mm:ss * * @return */ public static String getNowTime() { return allDateFmt.format(new Date()); } }