How to add/subtract TimeZone Offset to a Timestamp in Java?
问题 I am using JDK 8 and I played with ZonedDateTime and Timestamp a lot. But still I am not able to get a solution for the problem I am facing. Lets say I get a formatted Timestamp in GMT (UTC) and my server is located somewhere. Lets say it's set to Asia/Calcutta TimeZone (whose ZoneOffset is +05:30 ). How to basically add/subtract my time zone offset to the Timestamp? Input : 2017-09-13 13:10:30.333 Output: 2017-09-13 18:40:30.333 Explanation : In the input, the timezone offset which is 5hrs