更新时间:2023-09-19 23:19:46
好的,进一步谷歌搜索给了我自己问题的答案:使用 withOffsetParsed()
,如下:
OK, further Googling gave me the answer to my own question: use withOffsetParsed()
, as so:
final DateTimeFormatter df = DateTimeFormat
.forPattern("EEE MMM dd HH:mm:ss 'GMT'Z yyyy");
final DateTime dateTime = df.withOffsetParsed()
.parseDateTime("Mon Aug 24 12:36:46 GMT+1000 2009");
这行得通.