获取当前的日期,格式为:20190910 */ def getTodayDate(): String = { // a. 获取当前日期 val nowDate = new Date() // b. 转换日期格式 FastDateFormat.getInstance(“yyyyMMdd”).format(nowDate) }
使用FastDateFormat进行日期的转换/**获取当前的日期,格式为:20190910*/def getTodayDate(): String = {// a. 获取当前日期val nowDate = new Date()// b. 转换日期格式FastDateFormat.getInstance(“yyyyMMdd”).format(nowDate)}由于JDK里自...