title: Datetime in java
body: <p>I have a JDBC current <strong>date and time</strong> insert into Mysql Database. </p>
  
  <p>It submits the current date and a fixed time into the Mysql date type field as <code>2012/05/25 00:00:00</code>.  The date part works very fine but the time doesn't shows any value.</p>
  
  <p>I'm inserting the value with the following code:</p>
  
  <pre><code>java.util.Date myDate = new java.util.Date();
  java.sql.Date sqlDate = new java.sql.Date(myDate.getTime());
  PreparedStatement PStmt = con.prepareStatement(Sql query);
  PStmt.setDate(1,sqlDate);
  </code></pre>