title: Java/Servlet: get current sql.Date
body: <p>What I need to do is:</p>
  
  <p>1) Get user's locale from request.</p>
  
  <p>2) Create new sql.Date object with current date and time, based on user's locale</p>
  
  <p>3) Write it in MySQL db, column type: TIMESTAMP</p>
  
  <p>What I got is:</p>
  
  <pre><code>java.util.Locale locale = request.getLocale();
  
  java.text.DateFormat dateFormat =
  java.text.DateFormat.getDateTimeInstance(
                          java.text.DateFormat.LONG, java.text.DateFormat.LONG, locale );
  
  java.util.Date date = new java.util.Date();
  
  java.sql.Date sqlDate = new java.sql.Date( date.getTime() );
  </code></pre>
  
  <p>Date is OK, but have a problem with time - always 12:00:00 AM.</p>
  
  <p>Any suggestions? Is there a more efficient way to do this?</p>