![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据类型转换
Chloe_RO
这个作者很懒,什么都没留下…
展开
-
LocalDateTime与Date相互转换
LocalDateTime 转 DateLocalDateTime localDateTime=LocalDateTime.now()Date date = Date.from(localDateTime.atZone( ZoneId.systemDefault()).toInstant());Date 转 LocalDateTimeDate startDate=new Date();LocalDateTime localDateTime = startDate.toInstant()原创 2021-12-16 19:22:27 · 1326 阅读 · 2 评论 -
Java日期Date转换字符串String(SimpleDateFormat)
使用抽象类-DateForamt的子类SimpleDateFormat: Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); System.out.println(sdf.format(date)); sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.pr原创 2021-12-08 19:25:17 · 1921 阅读 · 0 评论 -
int类型转换成·Long
int count = 15;//创建Long对象Long changeCount =new Long(count);//因为int和long都是基本类型,能够互相转换long changCount= new long(count);错误转换方式//Long是包装类,而int是值类型数据,两者是不能强转× Long changeCount =Long(count);...原创 2021-12-01 09:00:20 · 4250 阅读 · 0 评论