title: getting current time in groovy/java
body: <p>I have the following code in groovy to get current time in hours.</p>
  
  <pre><code>def now = new Date()
    def time = now.getHours()
  </code></pre>
  
  <p>but the getHour() method is deprecated. What are the disadvantages if I use this method and the what is the alternative to this method in groovy/Java ?</p>