zoukankan      html  css  js  c++  java
  • 计算环比日期选择

    if ("week".equals(dto.getDatetype())) {
                prm.setStartDate(Integer.parseInt(beginDate.minusWeeks(1).withDayOfWeek(1).toString(DateUtils.DAY_FORMAT)));
                prm.setEndDate(Integer.parseInt(endDate.minusWeeks(1).withDayOfWeek(7).toString(DateUtils.DAY_FORMAT)));
            }
            if ("month".equals(dto.getDatetype())) {
                prm.setStartDate(Integer.parseInt(beginDate.minusMonths(1).withDayOfMonth(1).toString(DateUtils.DAY_FORMAT)));
                prm.setEndDate(Integer.parseInt(endDate.minusMonths(1).dayOfMonth().withMaximumValue().toString(DateUtils.DAY_FORMAT)));
            }
            if ("year".equals(dto.getDatetype())) {
                prm.setStartDate(Integer.parseInt(beginDate.minusYears(1).withDayOfYear(1).toString(DateUtils.DAY_FORMAT)));
                prm.setEndDate(Integer.parseInt(endDate.minusYears(1).dayOfYear().withMaximumValue().toString(DateUtils.DAY_FORMAT)));
            }
            if ("yesterday".equals(dto.getDatetype())) {
                prm.setStartDate(Integer.parseInt(beginDate.minusDays(1).toString(DateUtils.DAY_FORMAT)));
                prm.setEndDate(Integer.parseInt(endDate.minusDays(1).toString(DateUtils.DAY_FORMAT)));
            }
  • 相关阅读:
    动态字节码技术Javassist
    自己实现简单版的注解Mybatis
    AOP实现事务和记录日志
    自己实现简单版SpringMVC
    静态变量
    docker安装nginx , 安装mysql5.6,安装redis3.2
    Worker Thread模式
    linux 安装jdk
    dockfile构建自己的tomcat
    docker使用2
  • 原文地址:https://www.cnblogs.com/lqblods/p/15494664.html
Copyright © 2011-2022 走看看