title: SpringBoot deserializing json instant to next day
body: <p>So I observed how <code>@FutureOrPresent</code> was complaining for present date also. Debugging my code further</p>
  <pre><code>public class MyCustomDeserializer extends JsonDeserializer&lt;Instant&gt; {
      private DateTimeFormatter fmt = DateTimeFormatter.ofPattern(&quot;dd-MM-yyyy&quot;).withZone(ZoneOffset.UTC);
  
      @Override
      public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
          LocalDate date = LocalDate.parse(p.getText(), fmt);
          Instant instant = date.atStartOfDay(ZoneId.of(&quot;UTC&quot;)).toInstant();
          return instant;
      }
  }
  </code></pre>
  <p>Debugging gives me this state:</p>
  <p><a href="https://i.stack.imgur.com/FxPSv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FxPSv.png" alt="state" /></a></p>
  <p>Any idea how this can be worked around? I'm in Asia/Kolkate zone if that helps</p>
  <p>If I am passing current date in <code>fromDate</code> in the JSON file I'm getting this error:</p>
  <p><code>fromDate Must Be Of Future Or Present</code></p>
  <p>The POJO has this format</p>
  <pre><code>@JsonDeserialize(using = MyCustomDeserializer.class)
      @JsonSerialize(using = MyCustomSerializer.class)
      @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = &quot;dd-MM-yyyy&quot;)
      @NotNull(message = &quot;Please provide From Date&quot;)
      @FutureOrPresent(message = &quot;From Date Must Be Of Future Or Present&quot;)
      private Instant fromDate;
  </code></pre>