gpt4 book ai didi

java - SimpleDateFormat解析错误

转载 作者:行者123 更新时间:2023-12-01 21:40:47 25 4
gpt4 key购买 nike

我收到此错误:

java.text.ParseException: Unparseable date: "Fri Apr 08 2016 00:00:00 GMT+0530 (IST)"

我已经使用了这个SimpleDateFormat,有人可以建议我一个正确的吗?

SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z (Z)");

最佳答案

如果您的喂食日期为“Fri Apr 08 2016 00:00:00 GMT+0530 (IST)”。那么就错了。请删除 GMT。所有时区均仅从 GMT 开始计算。

尝试将日期传递为“Fri Apr 08 2016 00:00:00 +0530 (IST)”。它会起作用的。

关于java - SimpleDateFormat解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36498530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com