Here you can find the source of getAllnowTime()
public static String getAllnowTime()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static final String LONG_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static String getAllnowTime() { SimpleDateFormat df = new SimpleDateFormat(LONG_TIME_FORMAT); String nowtime = df.format(Calendar.getInstance().getTime()); return nowtime; }// w w w . j a va2 s.com }