title: How to obtain a timestamp in Java and store in MySQL database?
body: <p>I'm developing a basic CMS uses JSP/Servlet Technology using the MVC padagim.
  When a new post is added I want to get the date and time the post was created and store it as TIMESTAMP or DATATIME data type. 
  What is the best way to do it? And how do I Do it? </p>
  
  <p>The algorithm should be like this</p>
  
  <p>In a java web program (such as servlet)</p>
  
  <ol>
  <li>Get Time stamp (current time)</li>
  <li>Store in time stamp in a variable </li>
  <li>Pass sql query to store the timestamp in mysql db</li>
  </ol>
  
  <p>Please help! </p>
  
  <p>I have seen many answers, but I Don't understand those as I'm quite new to Java and jsp technology! </p>