@@ -716,7 +716,8 @@ public static String getFriendlyTimeSpanByNow(Date date) {
716
716
public static String getFriendlyTimeSpanByNow (long millis ) {
717
717
long now = System .currentTimeMillis ();
718
718
long span = now - millis ;
719
- if (span < 0 ) return String .format ("%tc" , new Date (millis ));
719
+ if (span < 0 )
720
+ return String .format ("%tc" , millis );// U can read http://www.apihome.cn/api/java/Formatter.html to understand it.
720
721
if (span < 1000 ) {
721
722
return "刚刚" ;
722
723
} else if (span < ConstUtils .MIN ) {
@@ -727,11 +728,11 @@ public static String getFriendlyTimeSpanByNow(long millis) {
727
728
// 获取当天00:00
728
729
long wee = (now / ConstUtils .DAY ) * ConstUtils .DAY ;
729
730
if (millis >= wee ) {
730
- return String .format ("今天%tR" , new Date ( millis ) );
731
+ return String .format ("今天%tR" , millis );
731
732
} else if (millis >= wee - ConstUtils .DAY ) {
732
- return String .format ("昨天%tR" , new Date ( millis ) );
733
+ return String .format ("昨天%tR" , millis );
733
734
} else {
734
- return String .format ("%tF" , new Date ( millis ) );
735
+ return String .format ("%tF" , millis );
735
736
}
736
737
}
737
738
@@ -1082,8 +1083,8 @@ public static String getChineseZodiac(int year) {
1082
1083
return CHINESE_ZODIAC [year % 12 ];
1083
1084
}
1084
1085
1085
- private static final String [] ZODIAC = {"水瓶座" , "双鱼座" , "白羊座" , "金牛座" , "双子座" , "巨蟹座" , "狮子座" , "处女座" , "天秤座" , "天蝎座" , "射手座" , "魔羯座" };
1086
- private static final int [] ZODIAC_FLAGS = {20 , 19 , 21 , 21 , 21 , 22 , 23 , 23 , 23 , 24 , 23 , 22 };
1086
+ private static final String [] ZODIAC = {"水瓶座" , "双鱼座" , "白羊座" , "金牛座" , "双子座" , "巨蟹座" , "狮子座" , "处女座" , "天秤座" , "天蝎座" , "射手座" , "魔羯座" };
1087
+ private static final int [] ZODIAC_FLAGS = {20 , 19 , 21 , 21 , 21 , 22 , 23 , 23 , 23 , 24 , 23 , 22 };
1087
1088
1088
1089
/**
1089
1090
* 获取星座
0 commit comments