
java
java后端开发技术
猿一码
这个作者很懒,什么都没留下…
展开
-
去掉json字符串多余的符号
JSON字符串转json对象原创 2023-01-31 10:02:22 · 894 阅读 · 0 评论 -
验证ip是否ping通
/** * 简单说明:验证ip是否ping通 <br> * @param ip * @return boolean **/public static boolean isPingPassByIp(String ip) { boolean isConnect = false; Runtime runtime = Runtime.getRuntime(); Process process; try { process = runtime.exec("p.原创 2020-09-07 17:43:38 · 436 阅读 · 0 评论 -
java时间推迟 n 天
/** * 时间推迟 n 天 **/ public static Date datePushBackByDays(Date date, int num){ Calendar calendar = Calendar.getInstance(); calendar.setTime(date); //date放到Calender对象中 calendar.add(Calendar.DATE, num);//后增加n天 .原创 2020-08-27 16:18:51 · 449 阅读 · 0 评论 -
java与当前时间比较大小
/** * 与当前时间比较大小 * @param data 比较时间 **/ public static int compareToCurrentTime(Date date){ int num = 0; //当前时间 long currentTime = System.currentTimeMillis(); long argTime = date.getTime(); if(curre.原创 2020-08-27 16:00:08 · 2181 阅读 · 0 评论 -
java获取两个日期之间的所有日期
```/** * 获取两个日期之间的所有日期(字符串格式, 按天计算) * * @param startTime String 开始时间 yyyy-MM-dd * @param endTime String 结束时间 yyyy-MM-dd * @return */public static List<String> getBetweenDays(String startTime, String endTime) throws Pa...原创 2020-08-25 15:59:56 · 2868 阅读 · 0 评论 -
java.util.Date转换为java.sql.Date
public java.sql.Date dataConversionUtil(String timeStr){ SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd");//小写的mm表示的是分钟 java.sql.Date dateSql = null; try { java.util.Date dateUt原创 2018-01-04 17:18:30 · 298 阅读 · 0 评论 -
Graphics2D 画图
/** * 画图 * * @param result 模版图片 * @param image 背景图片 * @return */ public BufferedImage setImageInTemplate(BufferedImage result, Image image) { try { //新生成图片 result = new BufferedImage(ImageW.原创 2020-08-25 17:16:18 · 573 阅读 · 0 评论