活动类型:5
parent
414f2c91db
commit
70576ce70a
|
@ -861,6 +861,25 @@ public class TimeUtils {
|
|||
return ca.getTimeInMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某个时间戳当前月份最后一天23:59:59秒时间戳
|
||||
*/
|
||||
public static long getMonthEndTime(Long time){
|
||||
//获取当前月最后一天
|
||||
Calendar ca = Calendar.getInstance();
|
||||
ca.setTimeInMillis(time);
|
||||
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
//将小时至0
|
||||
ca.set(Calendar.HOUR_OF_DAY, 23);
|
||||
//将分钟至0
|
||||
ca.set(Calendar.MINUTE, 59);
|
||||
//将秒至0
|
||||
ca.set(Calendar.SECOND,59);
|
||||
//将毫秒至0
|
||||
ca.set(Calendar.MILLISECOND, 1000);
|
||||
return ca.getTimeInMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* x:第几天
|
||||
* next:距离当前月几个月
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ToolsUtil {
|
|||
}
|
||||
}else if(type ==2){
|
||||
if(baseTime ==1){
|
||||
startTime = TimeUtils.getCurMonthEndTime();
|
||||
startTime = TimeUtils.getMonthEndTime(GameApplication.serverConfig.getCacheOpenTime());
|
||||
}else{
|
||||
startTime = TimeUtils.getMonthStartTime(GameApplication.serverConfig.getCacheOpenTime(),1,(int)baseTime);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue