[Java] 获取255年前芝加哥格式化时间
import java.time.LocalDate
import java.time.ZoneId
import java.time.format.DateTimeFormatter
def date = (LocalDate.now(ZoneId.of("America/Chicago")).minusYears(255)).format(DateTimeFormatter.BASIC_ISO_DATE)
import java.time.LocalDateTime import java.time.ZoneId import java.time.format.DateTimeFormatter def date = (LocalDateTime.now(ZoneId.of("Asia/Shanghai"))).format(DateTimeFormatter.ofPattern("yyyyMMddHHmm"))
String time = "2018-05-31" def dates = LocalDate.parse(time, DateTimeFormatter.ofPattern("yyyy-MM-dd")) log.info dates.format(DateTimeFormatter.ofPattern("yyyyMMdd"))