java 字符串yyyyMMdd格式化为yyyy-MM-dd日期格式

2018-06-12 15:21:37
/**    *将字符串格式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);
   }
  • 2020-12-21 14:00:19

    iframe + postMessage跨域通信

    在实际项目开发中可能会碰到在 a.com 页面中嵌套 b.com 页面,这时第一反应是使用 iframe,但是产品又提出在 a.com 中操作,b.com 中进行显示,或者相反。

  • 2020-12-22 12:02:41

    ios开发优秀的开源框架,demo集合

    期待大家和我们一起共同维护,同时也期望大家随时能提出宝贵的意见(直接提交issues即可)。请广大网友只按照目录结构(即使目录结构有问题)添加三方库,并提交pull request。目录问题大家提出issues后楼主会及时更改的。