Skip to content
Advertisement

How can I parse a date including timezone with Joda Time

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

JavaScript

It outputs:

JavaScript

whereas I expect:

JavaScript

Any ideas what I’m doing wrong?

Advertisement

Answer

OK, further Googling gave me the answer to my own question: use withOffsetParsed(), as so:

JavaScript

This works.

Advertisement