import java.text.SimpleDateFormat
import java.util.{
Calendar, Date, Random}
object TimeDateUtil {
def getNowDate():String={
var now:Date = new Date()
var dateFormat:SimpleDateFormat = new SimpleDateFormat("yyyyMMdd")
var today = dateFormat.format( now )
today
}
def getNowDateWithMiddleHorizontaLine():String={
var now:Date = new Date()
var dateFormat:SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd")
var today
05-21
8610
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)