title: Convert A DateTime With Given Offset to UTC Java
body: <p>Given that I have String "2019-11-05/23:00" and an offset "+07:00",</p>
  
  <p>How would I go About Converting It to LocalDateTime UTC in Java(8).</p>
  
  <p>My Current Code</p>
  
  <pre><code>@GetMapping("postDate/{date}")
  public void testPost(@RequestParam("timezone") String timeZone, @PathVariable String date) {
      String format = "yyyy-MM-dd-HH:mm";
      String offset = timeZone;
      System.out.println(date);
      LocalDateTime timeWithOffset = LocalDateTime.parse(date,
                                                         DateTimeFormatter.ofPattern(format));
  
      System.out.println("\n\n\n" + timeWithOffset + "\n\n\n");
  
      // Cant Figure Out to get LocalDateTime timeInUTC
  }
  </code></pre>
  
  <p>My Request From Postman</p>
  
  <p><a href="http://localhost:8080/postDate/2019-11-05-23:00?timezone=+07:00" rel="nofollow noreferrer">http://localhost:8080/postDate/2019-11-05-23:00?timezone=+07:00</a></p>