title: groovy date-format error within Jenkins CI
body: <p><br>
  we're just migrate our CI-platform (jenkins v1.538) from WinSrv2003 to WinSrv2008 via copy and paste all the job- and config files from the old server to the new on. Afterwards all jobs are running fine, except for an groovy job. Here we got an date-format error. The language and regional settings are correct (identical regional and date-settings on both servers). We also try to force the correct format within the code, but jenkins still throws the following error:</p>
  
  <pre><code>FATAL: java.util.Date cannot be cast to java.lang.String
  java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.String
  at java.lang.String.compareTo(Unknown Source)
  at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.compareToWithEqualityCheck(DefaultTypeTransformation.java:599)
  </code></pre>
  
  <p>groovy Code:</p>
  
  <pre><code>import hudson.model.*
  import hudson.FilePath
  import groovy.xml.MarkupBuilder
  import java.text.SimpleDateFormat
  ...
  def tsformat = "yyyy-MM-dd HH:mm:ss"
  def to_ts_format = new SimpleDateFormat(tsformat)
  def from_integrity_format = new SimpleDateFormat ("MMM dd, yyyy hh:mm:ss aa")
  
  .....
  try {
  ...
    xml.changereport (job:srcjobname, time:today.format (tsformat), predecessortime:predectime.format (tsformat)) {
  
  for (def b in builds) {       
    b_no = b.getNumber ()
    if (b_no &lt; from || b_no &gt; to) {
      println ("Skipped build: " + b_no)
      continue
    } else {
      println ("Processing build: " + b_no)
    }
  
    buildinfo (number:b.number, time:b.getTime ().format (tsformat)) {
      for (cs in b.changeSet) {
        for (ci in cs) {
          citime =  from_integrity_format.parse (ci.date)
          if (citime &gt; predectime) {
          ...
  </code></pre>
  
  <p>At the if-condition the error will thrown.</p>
  
  <p>Java-version (1.7.0), jenkins, groovy plugin etc are running with the same version as on the old server. Jobs and the groovy-scrip where not change. Is there something we forgot to configure on jenkins or server side?</p>
  
  <p>Thanks Steffen</p>