package com.test.dmp.task.bidease
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Calendar
import java.util.GregorianCalendar
object Test {
def main(args: Array[String]): Unit = {
val time = "20190716"
val sdf =new SimpleDateFormat("yyyyMMdd")
//字符串 转date类型
val dayDate :Date = sdf.parse(time)
val calendar = new GregorianCalendar;
calendar.setTime(dayDate);
//data时间减少1
calendar.add(Calendar.DAY_OF_MONTH,-1)//.add(calendar.DATE, 1);
val current: Date = calendar.getTime();
val startTime = sdf.format(current)
println("time::::"+startTime)
}
}