private static String time = "2019-01-11 11:11:11";
private static long timestamp = 1547176271000L;
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static void main(String[] args) {
dateFormatTest(x->{
try {
Date date = dateFormat.parse(time);
if (date.getTime() != timestamp){
System.out.println("转化错误:"+date);
}
} catch (Exception e) {
System.out.println("出现异常"+e.getMessage());
}
});
}
private static void dateFormatTest(Consumer runnable){
CountDownLatch countDownLatch = new CountDownLatch();
for (int i = ; i < ; i++) {
new Thread(()->{
runnable.accept(null);
countDownLatch.countDown();
}).start();
}
try {
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}

最新文章

  1. UNIX文件的权限之“设置用户ID位”
  2. 我的ORM之四--删除
  3. Python的下载与安装
  4. 理解 OpenStack Swift (1):OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置
  5. Css - 文本溢出处理
  6. mysql操作类库--摘抄
  7. [SAP ABAP开发技术总结]OLE
  8. RMAN-03009 ORA-19504 ORA-27038
  9. HTTP 1.1与HTTP 1.0的比较
  10. 关于柯尼卡美能达bizhub250出现c2557错误解决方法
  11. 【转】来自《轻松scrum之旅》的敏捷开发总结
  12. centos6 qt ENV
  13. CentOS7 安装Bind
  14. 关于C++中虚函数表存放位置的思考
  15. 微信公众号订阅号以及服务号通过网页授权获取用户openid方法
  16. C# 1-2+3-4+5...+m的几种方法
  17. 迭代器&amp;迭代对象&amp;生成器
  18. springboot项目简单启动脚本
  19. 域名打开没有加上“http://”,导致报错{&quot;code&quot;:-32603,&quot;message&quot;:&quot;Cannot navigate to invalid URL&quot;}
  20. RFC2544测试指标

热门文章

  1. Centos7 使用 supervisor 管理进程
  2. MySQL8.0.16新特性:The Communication Protocol In Group Replication
  3. Git 分支管理 解决冲突
  4. bzoj4889: [Tjoi2017]不勤劳的图书管理员(树套树)
  5. 洛谷P2522 [HAOI2011]Problem b(莫比乌斯反演)
  6. 程序员收藏必看系列:深度解析MySOL优化(一)
  7. Spring+SpringMVC+JDBC实现登录
  8. 基于 Laravel Route 的 ThinkSNS+ Component
  9. npm ERR! missing script: build
  10. 常见的div布局面试题