I have a timestamp string which comes from a MS SQL server database. Its value is 2021-04-11 10:25:33.000
, sql data type is datetime and time zone is PST i.e. pacific time. How do I convert this timestamp to UTC with Java? My expected result is 2021-04-11T17:25:33.000
which is UTC.
NOTE - I want to use only use Java 8 time libraries i.e. in the package java.time
. I don't want Calendar, Date, SimpleDateFormat etc.
PS - Initially, I tried to find a solution on stack overflow, but could not find anything for a few minutes. All the top searches for my question gave solutions in php, c# and javascript.