groovy date arithmetics do not work in pipeline

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Hi,

      The following date/time arithemetics which work in groovy - do not work in a pipeline script:

      import groovy.time.*
      def startDate = new Date()
      def timeout = startDate  + 1.hours //increment 1 hour
      

      use( TimeCategory ) doesn't help.

      I get the following error:
      groovy.lang.MissingPropertyException: No such property: hours for class: java.lang.Integer

      I also wasn't able to find any workaround for this - I was only able to increment integers (as in days)

            Assignee:
            Unassigned
            Reporter:
            Mor L
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: