Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Wrong date when reading out the date Input variables #3844

Laba42 ·

Hallo,
If I enter 31.12.2017 for a date input variable and then read the value with Groovy,

${groovy:
import java.util.Date
return vars.get("ExpireDate").getDateValue().format("yyyy-MM-dd")
}

I get the value 2017-12-30

${groovy:
import java.util.Date
return vars.get("ExpireDate").getDateValue()
}

or without formation Sat Dec 30 23:00:00 CET 2017

The evaluation always shows one day less than the number of days entered.

Georg

  • replies 3
  • views 590
  • stars 0
robinshen ADMIN ·

Please disable the "detect timezone" option in system setting and check if it works correctly. With that option turned on, QuickBuild assumes the input date to be local time of your browser.

Laba42 ·

The result is the same for both cases.

robinshen ADMIN ·

Tested on my machine and QB only allows date variable to be specified as 2017-12-31 instead of 31.12.2017. And with this format, the groovy script prints correct value.