diff --git a/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java b/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java index 9a9286f43..372762485 100644 --- a/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java +++ b/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java @@ -22,6 +22,7 @@ import java.net.SocketTimeoutException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; +import java.util.TimeZone; import retrofit2.HttpException; @@ -48,7 +49,8 @@ public class LogoutHelper { BanAccountException exception = (BanAccountException) e; String text = ResUtil.getString(R.string.login_helper_logouthelper_02) + exception.getMessage() + ResUtil.getString(R.string.login_helper_logouthelper_03); int start = text.length(); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ResUtil.getString(R.string.login_helper_logouthelper_04), Locale.getDefault()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ResUtil.getString(R.string.login_helper_logouthelper_04), Locale.ENGLISH); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08")); text += simpleDateFormat.format(new Date(exception.getDate())); SpannableString spannableString = new SpannableString(text); spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(activity, R.color.appColor)), @@ -57,7 +59,8 @@ public class LogoutHelper { spannableString, ResUtil.getString(R.string.login_helper_logouthelper_06), ResUtil.getString(R.string.login_helper_logouthelper_07), null); } else if (e instanceof AccountCancelException) { AccountCancelException exception = (AccountCancelException) e; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ResUtil.getString(R.string.login_helper_logouthelper_08), Locale.getDefault()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ResUtil.getString(R.string.login_helper_logouthelper_08), Locale.ENGLISH); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08")); String text = ResUtil.getString(R.string.login_helper_logouthelper_09) + simpleDateFormat.format(new Date(exception.getCancelDate())); int end = text.length();