获取需要转换的时区之后再获取时间
import java.text.SimpleDateFormat
TimeZone timeZone= TimeZone.getTimeZone("GMT-7:00")
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm")
sdf.setTimeZone(timeZone)
def nowtime = sdf.format(new Date())
vars.put("nowtime",nowtime)
println(nowtime)