- 博客(13)
- 收藏
- 关注
原创 获取距当前时间的差值年月日时分秒()
// 获取距当前时间的差值function timeDifference(dateString) { console.info("--------",dateString) var currentSecond = new Date().getTime(); var pushSecond = convertDateFromString(dateString).getTime(); var timeDifference = currentSecond - pushSecon.
2022-05-03 17:52:29
27
原创 double保留小数点后n位
import java.math.RoundingMode;import java.text.NumberFormat;public class test { public static void main(String[] args) { double d = 114.149; NumberFormat nf = NumberFormat.getNumberInstance(); // 保留两位小数 nf.setMaximum.
2022-03-14 11:30:39
34
原创 字符串 和 Date 互相转换
/** * 字符串转Date */ public Date strToDate(String str){ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = null; try { date = format.parse(str); } catch (ParseExce...
2022-02-17 10:39:27
215
原创 ajax返回List<自定义类>怎么取值
controller@RequestMapping("showUser") @ResponseBody public List<UserEntity> showUser(UserEntity user) { return userService.showUserService(user); }ajax取值success: function (data) { data[0];//第一个自定义类 data[0].uid;//第一
2022-01-12 21:40:08
144
原创 js 获取当前日期和时间
方法//显示日期在页面上 yyy-MM-dd function getTime(){ var date=new Date(); //年 var year=date.getFullYear(); //月 var month=pad((date.getMonth()+1),2); //日 var day=pad(date.getDate(),2); //时 var hh=pad(date.getHours(),2); /
2022-01-12 11:58:21
202
原创 生成订单号【16位】
/** * 是否包含字符串 * * @param str 验证字符串 * @param strs 字符串组 * @return 包含返回true */ public static boolean inStringIgnoreCase(String str, String... strs) { if (str != null && strs != null) { .
2021-12-31 16:15:03
215
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人