fix:调整部分场景的时间格式化-时区

This commit is contained in:
max
2024-06-07 14:27:22 +08:00
parent bc3426c574
commit 95d0527fc9

View File

@@ -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();