title: Spring convert localtime to UTC
body: <p>I have many clients, each in a different time zone. I want that once a client calls my API and passes localtime, the localtime will be converted to UTC time on my server.</p>
  
  <p>Reason for that is that I want to save the UTC time to database using Spring JPA, I cannot save it's local time becuase it will be wrong.</p>
  
  <p>What do you suggest?</p>
  
  <pre><code>import org.springframework.format.annotation.DateTimeFormat;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.RestController;
  
  import java.time.LocalDate;
  
  @RestController
  @RequestMapping("/api/datetime/")
  final class DateTimeController {
  
      @RequestMapping(value = "date", method = RequestMethod.POST)
      public void processDate(@RequestParam("date") LocalDate date) {
          // convert the LocalTime to UTC and save to DB
      }
  }
  </code></pre>