This snippet of code always parses the date into the current timezone, and not into the timezone in the string being parsed. It outputs: whereas I expect: Any ideas what I’m doing wrong? Answer OK, further Googling gave me the answer to my own question: use withOffsetParsed(), as so: This works.
Tag: datetime
How to convert java.util.Date to java.sql.Date?
I am trying to use a java.util.Date as input and then creating a query with it – so I need a java.sql.Date. I was surprised to find that it couldn’t do the conversion implicitly or explicitly – but I don’t even know how I would do this, as the Java API is still fairly new to me. Answer tl;dr How