title: How to get the current date and time of your timezone in Java?
body: <p>I have my app hosted in a London Server. I am in Madrid, Spain. So the timezone is -2 hours. </p>
  
  <p>How can I obtain the current date / time with my time zone.</p>
  
  <pre><code>Date curr_date = new Date(System.currentTimeMillis());
  </code></pre>
  
  <p>e.g. </p>
  
  <pre><code>Date curr_date = new Date(System.currentTimeMillis("MAD_TIMEZONE"));
  </code></pre>
  
  <h3>With <a href="http://www.joda.org/joda-time/" rel="noreferrer">Joda-Time</a></h3>
  
  <pre><code>DateTimeZone zone = DateTimeZone.forID("Europe/Madrid");
  DateTime dt = new DateTime(zone);
  int day = dt.getDayOfMonth();
  int year = dt.getYear();
  int month = dt.getMonthOfYear();
  int hours = dt.getHourOfDay();
  int minutes = dt.getMinuteOfHour();
  </code></pre>