title: Storing java 8 LocalDate in mongo DB
body: <p>Using Spring Boot <code>1.5.4.RELEASE</code> and Mongo driver <code>3.4.2</code>.</p>
  <p>I want to store <code>LocalDate</code> in <code>mongo DB</code>, but I am facing a weird problem:</p>
  <pre><code>LocalDate startDate = LocalDate.now();
  LocalDate endDate = LocalDate.of(2020,12,01);
  System.out.println(&quot;---- StartDate : ---&quot;+startDate); 
  System.out.println(&quot;-----End Date : ----&quot;+endDate);
          
          repository.save(new Person(&quot;Mehraj&quot;,&quot;Malik&quot;, startDate, endDate));
  </code></pre>
  <p>Output on console:</p>
  <blockquote>
  <p>---- StartDate : ---2017-08-26</p>
  <p>-----End Date : ----2020-12-01</p>
  </blockquote>
  <p>But In MongoDb it is storing incorrect dates.</p>
  <p>Following is the json from MongoDb:</p>
  <blockquote>
  <p>&quot;startDate&quot; : ISODate(&quot;2017-08-25T18:30:00.000Z&quot;),</p>
  <p>&quot;endDate&quot; :ISODate(&quot;2020-11-30T18:30:00.000Z&quot;)</p>
  </blockquote>
  <p>Also, I have noticed that the stored time is also incorrect according to Indian time.</p>
  <p>Why the dates are correct on console but not in MongoDB and how to resolve this problem?</p>