![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
个人代码总结
qq_45739213
这个作者很懒,什么都没留下…
展开
-
获取时间的小时数的方法
方法一 LocalTime time = LocalTime.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH"); String hour = time.format(formatter); 方法二 GregorianCalendar calendar = new GregorianCalendar(); int hour = calendar.get(原创 2020-10-19 08:34:08 · 856 阅读 · 0 评论 -
html时间戳转日期
//后台--获取当前时间的时间戳 long startTime = System.currentTimeMillis(); //页面--转换成年月日时分秒 var startTime = new Date([[${startTime}]]).toLocaleString(); //换成想要的时间格式2020-10-13 10:20:21,重写 toLocaleString 方法 Date.prototype.toLocaleString = function() { return this.getFul原创 2020-10-15 10:29:19 · 884 阅读 · 0 评论 -
页面js时间比较
想获取一天中的8:00-17:00,用毫秒时间戳进行比较 //获取当前时间 var date = new Date(); //当前时间的时间戳(ms) 也可以用.getTime()获取时间戳 var currentdate = Math.round(new Date()); //当天8:00的时间戳 var eightClock = new Date(date.getFullYear() + "-" + month + "-" + date.getDate() +" 08:00:00").getTime原创 2020-10-14 09:16:34 · 224 阅读 · 0 评论 -
List<HashMap<String,Object>>转成List<实体>
List<HashMap<String,Object>> hashMapList = new ArrayList<HashMap<String,Object>>(); HashMap map=new HashMap(); map.put("id", 1); hashMapList .add(map); //有一个hashMapList ,那么如何转换成List套实体,如下: JSONArray jsonArray...原创 2020-10-14 09:08:37 · 2907 阅读 · 0 评论