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