title: Printing out datetime in a specific format in Java?
body: <p>I want to print out datetime in java in a specific format. I have this C# code which prints out the datetime in this format. </p>
  
  <pre><code>DateTime value = new DateTime(2010, 1, 18);
  Console.WriteLine(value);
  Console.WriteLine(value == DateTime.Today);
  </code></pre>
  
  <p>The result is - 1/18/2010 12:00:00 AM</p>
  
  <p>Now, I want to write a java code that prints out the datetime in the same format. I used the joda.time library. This is what I tried so far.</p>
  
  <pre><code>DateTime today = new DateTime();
  System.out.println(today.toString(“yyyy-MMM-dd”));
  </code></pre>
  
  <p>How can I pass the year,month and day as the constructor in the DateTime in java and print out in the above format. </p>