mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 会员钱包明细
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.common.util;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -20,11 +21,7 @@ import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
@@ -938,4 +935,42 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据年月获取月初第一天日期
|
||||
* @param year
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
public static String getFirstDay(int year,int month,String format) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
|
||||
cale.set(Calendar.YEAR, year); //赋值年份
|
||||
cale.set(Calendar.MONTH, month - 1);//赋值月份
|
||||
int lastDay = cale.getActualMinimum(Calendar.DAY_OF_MONTH);//获取月最大天数
|
||||
cale.set(Calendar.DAY_OF_MONTH, lastDay);//设置日历中月份的最大天数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);//格式化日期yyyy-MM-dd
|
||||
String lastDayOfMonth = sdf.format(cale.getTime());
|
||||
return lastDayOfMonth;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据年月获取月末最后一天日期
|
||||
* @param year
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
public static String getLastDay(int year,int month,String format) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
|
||||
cale.set(Calendar.YEAR, year);//赋值年份
|
||||
cale.set(Calendar.MONTH, month - 1);//赋值月份
|
||||
int lastDay = cale.getActualMaximum(Calendar.DAY_OF_MONTH);//获取月最大天数
|
||||
cale.set(Calendar.DAY_OF_MONTH, lastDay);//设置日历中月份的最大天数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format); //格式化日期yyyy-MM-dd
|
||||
String lastDayOfMonth = sdf.format(cale.getTime());
|
||||
return lastDayOfMonth;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user