会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
仲秋呀
博客园
首页
新随笔
联系
订阅
管理
2021年7月27日
记 MySQL 8位日期格式 截取月份 并补0 格式化
摘要: MONTH(20210101) --> 截取月份 LPAD(参数, 总长度, 补什么) --> 填充字符串左边 LPAD(123, 5, 0) --> 00123 LPAD(MONTH(20210101), 2, 0) --> 01
阅读全文
posted @ 2021-07-27 17:18 仲秋呀
阅读(624)
评论(0)
推荐(1)
2021年7月23日
把byte转化为KB、MB、GB
摘要: /** * @Description : 把byte转化为KB、MB、GB **/ public static String getNetFileSizeDescription(long size) { StringBuffer bytes = new StringBuffer(); Decimal
阅读全文
posted @ 2021-07-23 14:37 仲秋呀
阅读(1469)
评论(0)
推荐(0)
Java 相对时间 工具类
摘要: /** * 相对时间 * @param date 传入时间 与 当前时间做比较 返回相差的日期 > 相对时间 * @return */ public static String dateToRelativeTime(Date date){ SimpleDateFormat df = new Simp
阅读全文
posted @ 2021-07-23 14:35 仲秋呀
阅读(134)
评论(0)
推荐(0)
传入时间 与 当前时间做比较 返回相差的日期 ---> 返回 天 时 分 秒
摘要: /** * 返回 天 时 分 秒 * @param date 传入时间 与 当前时间做比较 返回相差的日期 > 返回 天 时 分 秒 * @return */ public static String dateToDayHourMinuteSecond(Date date){ SimpleDateF
阅读全文
posted @ 2021-07-23 14:35 仲秋呀
阅读(73)
评论(0)
推荐(0)
日期工具类 - 8位数字日期格式 转换成 带"-" 的格式化
摘要: 下方 这个是 传入 String类型 /** * 8位数字日期格式 转换成带 "-" 的格式化 20210701 --> 2021-07-01 * @param number * @return */ public static String numberToDateFormat(String nu
阅读全文
posted @ 2021-07-23 14:33 仲秋呀
阅读(743)
评论(0)
推荐(0)
2021年4月23日
数学运算得结果为百分比的数值
摘要: /** * divisor 除数 * dividend 被除数 */ public String getPercentage() { int v = (int) ((new BigDecimal((float) divisor / dividend ).setScale(2, BigDecimal.
阅读全文
posted @ 2021-04-23 17:20 仲秋呀
阅读(70)
评论(0)
推荐(0)
2021年1月25日
MyBatis中的模糊查询
摘要: 在DML中 , 模糊查询用 LIKE '%' 实现 , 那么在Mybatis中怎么去实现呢? 一顿操作猛如虎 , 敲出以下代码 : 1 <select id='test'> 2 SELECT 3 * 4 FROM 5 test 6 WHERE 7 test_name LIKE %{test_name
阅读全文
posted @ 2021-01-25 14:40 仲秋呀
阅读(70)
评论(0)
推荐(0)
公告