Import java.text. SimpleDateFormat;SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss”);Date dat=new Date();//把日期转化为字符串String str... [simpledateformat]