import java.text.SimpleDateFormat; import java.util.Date;
SimpleDateFormat formatter = new SimpleDateFormat ("MM月dd日yyyy年");//("yyyy年MM月dd日 HH:mm:ss ") Date curDate = new Date(System.currentTimeMillis());//获取当前时间 String str = formatter.format(curDate);
Toast.makeText(context,"data="+str,Toast.LENGTH_LONG).show();