日期处理

86 阅读1分钟

将当前毫秒值转换为固定格式

        val date = Date(System.currentTimeMillis())
        val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
        println(format.format(date))