spring mvc中,如果时间格式是yyyy-MM-dd,传入后台会报错,要增加一些配置才可以. 1.修改spring-mvc.xml,增加org.springframework.format.support.DefaultFormattingConversionService <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
System.out.println("Hello World!"); SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss");//设置时间格式 Date currentTime = new Date();//获取当前时间 String date=format.format(currentTime);//对当前时间进行格式化 currentTime=format.parse(dat