diff --git a/src/main/java/com/kwan/springbootkwan/controller/VueChatController.java b/src/main/java/com/kwan/springbootkwan/controller/VueChatController.java index f75b4d28fef5cbb8e180a91c20da9be27f5cd7e7..59e01568aad1cfdb15dae78a61abfa84fe883fcc 100644 --- a/src/main/java/com/kwan/springbootkwan/controller/VueChatController.java +++ b/src/main/java/com/kwan/springbootkwan/controller/VueChatController.java @@ -100,5 +100,7 @@ public class VueChatController { public Result delete(@RequestParam("idList") List idList) { return Result.ok(this.vueChatService.removeByIds(idList)); } + + } diff --git a/src/main/java/com/kwan/springbootkwan/utils/DateUtils.java b/src/main/java/com/kwan/springbootkwan/utils/DateUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..5f10fad48560c2da9b53db1762fa2d36806da174 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/utils/DateUtils.java @@ -0,0 +1,26 @@ +package com.kwan.springbootkwan.utils; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; + +/** + * 时间工具类 + * + * @author : qinyingjie + * @version : 2.2.0 + * @date : 2023/7/21 23:29 + */ +public class DateUtils { + public static void main(String[] args) { + // 获取当前日期时间 + DateTime now = DateUtil.date(); + // 获取当前日期所在的周数 + int weekOfYear = DateUtil.weekOfYear(now); + // 获取当前日期所在的月份,并格式化为两位数字 + String month = String.format("%02d", DateUtil.month(now) + 1); + // 将周数和月份拼接成字符串 + String result = StrUtil.format("当前日期所在的周数:{},当前日期所在的月份:{}", weekOfYear, month); + System.out.println(result); + } +}