-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTC时间转换错误 #127
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
大神的UTC时间转换太暴力了,可以这样
@Nullable
public static String subStandardTime(String time) throws ParseException {
SimpleDateFormat formatUTC = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z");
Date date = formatUTC.parse(time.replace("Z", " UTC"));
SimpleDateFormat formatGST = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return formatGST.format(date);
}
The text was updated successfully, but these errors were encountered: