登录签名认证 专题列表开服时间格式更改 收藏优化
This commit is contained in:
@ -99,23 +99,21 @@ public class GameViewUtils {
|
||||
try {
|
||||
long today = format.parse(format.format(new Date())).getTime();
|
||||
long day = Long.parseLong(testTime + "000");
|
||||
Calendar calendar = Calendar.getInstance(TimeZone
|
||||
.getTimeZone("Asia/Shanghai"));
|
||||
calendar.setTimeInMillis(day);
|
||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm", Locale.CHINA);
|
||||
String time = timeFormat.format(day);
|
||||
|
||||
if (day >= today && day < today + 86400 * 1000) {
|
||||
testDate = "今天" + hour + "点";
|
||||
testDate = "今天 " + time;
|
||||
} else if (day >= today + 86400 * 1000
|
||||
&& day < today + 86400 * 1000 * 2) {
|
||||
testDate = "明天" + hour + "点";
|
||||
testDate = "明天 " + time;
|
||||
} else if (day >= today + 86400 * 1000 * 2
|
||||
&& day < today + 86400 * 1000 * 3) {
|
||||
testDate = "后天" + hour + "点";
|
||||
testDate = "后天 " + time;
|
||||
} else if (day >= today - 86400 * 1000 && day < today) {
|
||||
testDate = "昨天" + hour + "点";
|
||||
testDate = "昨天 " + time;
|
||||
} else {
|
||||
format = new SimpleDateFormat("MM-dd", Locale.CHINA);
|
||||
testDate = format.format(day) + " " + hour + "点";
|
||||
testDate = new SimpleDateFormat("MM-dd HH:mm", Locale.CHINA).format(day);
|
||||
}
|
||||
return testDate;
|
||||
} catch (ParseException e) {
|
||||
|
||||
Reference in New Issue
Block a user