title: How to format following date time value as it is in the database?
body: <p>I'm using Java 8 <code>LocalDateTime</code> and convert it into a <code>Timestamp</code> format. output of the <code>timeStampOfTodayMidNight</code> is = <code>2019-07-03 00:00:00.0</code> . But I want in this format = <code>03-JUL-19 15:05:31</code>. I tried lot to format this but could not. can anyone help me here?
  Thanks.</p>
  
  <pre><code>LocalTime midnight = LocalTime.MIDNIGHT;
  LocalDate today = LocalDate.now(ZoneId.of(environment.getProperty("axipay.time.zone")));
  LocalDateTime todayMidnight = LocalDateTime.of(today, midnight);
  LocalDateTime tomorrowMidnight = todayMidnight.plusDays(1);
  Date timeStampOfTodayMidNight = java.sql.Timestamp.valueOf(todayMidnight);
  </code></pre>