import java.text.SimpleDateFormat
object TimeStampTest {
// maim
def main(args: Array[String]): Unit = {
// 获取系统的时间戳
val tsLong = System.currentTimeMillis()
//println(tsLong) // 1575871214234
// 根据获取的时间戳 计算系统的时间
val sdf0 = new SimpleDateFormat("HH:mm:ss").format(tsLong)
//println(sdf0) // 14:00:14
// 代码调试
val sdf1 = new SimpleDateFormat("HH:mm:ss").format(1575871214234L)
println(sdf1) // 14:00:14
val sdf2 = new SimpleDateFormat("HH:mm:ss").format(1575871214000L)
println(sdf2) // 14:00:14
// 代码调试
val sdf3 = new SimpleDateFormat("HH:mm:ss").format(1575871540720L)
println(sdf3) // 14:05:40
val sdf4 = new SimpleDateFormat("HH:mm:ss").format(1575871540000L)
println(sdf4) // 14:05:40
}
}