修复bug

This commit is contained in:
admin
2022-10-13 16:04:14 +08:00
parent 29422d1c04
commit 7ab231a76f
6 changed files with 12 additions and 122 deletions

View File

@@ -29,8 +29,7 @@ import org.apache.commons.lang.time.DateUtils;
public class Utils {
public static void main(String[] args) {
String s = floatToString(0.01235788889f, 3,false);
System.out.println(s);
getWeekNum();
}
/**
@@ -702,12 +701,6 @@ public class Utils {
*/
public static long getDatePoor(Date endDate, Date nowDate) {
long nd = 1000 * 24 * 60 * 60;// 一天
long nh = 1000 * 60 * 60;// 一小时
long nm = 1000 * 60;// 一分钟
long ns = 1000;// 一秒
// 获得两个时间的毫秒时间差异
@@ -718,6 +711,13 @@ public class Utils {
return sec;
}
/**获取今天是周几1-7*/
public static long getWeekNum() {
long[] weekDays = {7,1,2,3,4,5,6};
Calendar c = Calendar.getInstance();
return weekDays[c.get(Calendar.DAY_OF_WEEK)-1];
}
/**
* 获取用户真实ip