How can I parse a date including timezone with Joda Time

后端 未结 2 1232
半阙折子戏
半阙折子戏 2020-12-09 01:27

This snippet of code always parses the date into the current timezone, and not into the timezone in the string being parsed.

final DateTimeFormatter df          


        
2条回答
  •  心在旅途
    2020-12-09 02:07

    also you can chose:

    // parse using the Paris zone
    DateTime date = formatter.withZone(DateTimeZone.forID("Europe/Paris")).parseDateTime(str);
    

提交回复
热议问题