title: Groovy's java.util.Date or Java's java.util.Date?
body: <p>I have a Java application that is running embedded groovy scripts using a <code>GroovyClassLoader</code>. Everything is working great until I hit an odd error while passing Java types to a Groovy script.</p>
  
  <p>My issue is thus: I am passing a <code>java.util.Date</code> as a parameter into a groovy script. I found that Groovy's java.util.Date has a fantastic <a href="http://groovy.codehaus.org/groovy-jdk/java/util/Date.html#clearTime%28%29" rel="nofollow" title="Groovy's clearTime&#40;&#41;">clearTime()</a> function. However when I try to call this function i get this exception:</p>
  
  <pre><code>groovy.lang.MissingMethodException: No signature of method: java.util.Date.clearTime() is applicable for argument types: () values: []
  </code></pre>
  
  <p>I assume this because I have a Java Date and not a Groovy Date. Is there a way to convert between the two.</p>
  
  <p>I do admit I don't fully understand how Groovy seems to be overriding jdk types. (So much so I don't even know if this is the correct terminology to use here.) Please correct me if I am completely wrong about what happens when you create a java.util.Date inside of Groovy vs. when you pass one in to a function from Java.</p>