/** *将字符串格式yyyyMMdd的字符串转为日期,格式"yyyy-MM-dd" * * @param date 日期字符串 * @return 返回格式化的日期 * @throws ParseException 分析时意外地出现了错误异常 */ public static String strToDateFormat(String date) throws ParseException {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
formatter.setLenient(false);
Date newDate= formatter.parse(date);
formatter = new SimpleDateFormat("yyyy-MM-dd"); return formatter.format(newDate);
}
java 字符串yyyyMMdd格式化为yyyy-MM-dd日期格式
-
laravel Eloquent 如何实现 FIND_IN_SET ,并实现分页
有个文章表里面有个type字段,他存储的是文章类型,有 1头条,2推荐,3热点,4图文 .....11,12,13等等 现在有篇文章他既是 头条,又是热点,还是图文,
-
MySQL关于根据日期查询数据的sql语句
MySQL关于根据日期查询数据的sql语句
-
Failed to read artifact descriptor for org.apache.axis:axis:jar:1.4
pom这个报错,不一定是真的报错,看看下面的详解吧
-
cannot cast 'javax.xml.rpc.Call' to 'org.apache.axis.client.Call
用java调用axis报错的解决方案
-
jquery animate 连续点击不能平滑滚动的原因
通过设置延迟的方式解决平滑滚动
-
E45: 'readonly' option is set (add ! to override)
E45: 'readonly' option is set (add ! to override)
-
nginx 安装提示缺少pcre
经查看我的服务器里面有pcre,为什么还提示我缺少pcre。
-
启动Tomcat6.x时,manager does not exist or is not a readable directory-解决
几天重新安装了Tomcat6,安装完Tomcat6后在wepapps下面会有一些tomcat自带的项目(root、manager、host-manager等几个),这几天项目没什么用我就删掉了,后来在MyEclipse中配置好Tomcat,新建web项目,在启动Tomcat是会出现
-
Unable to set localhost. This prevents creation of a GUID
今天部署服务器,莫名其妙的出现了这样的问题,以前从没这情况过。
-
七牛上传图片 open failed: EACCES (Permission denied)
好久不做安卓了,把原来工程的七牛上传图片的代码粘贴过来,运行竟然出错了