toklin 时间格式化 android toklin 时间格式化
toklin 时间格式化 android toklin 时间格式化
// Date 同时包含日期和时间 val date1 = Date(); // 当前时间 val millisencond = date1.time // 时间戳,毫秒 val date2 = Date(millisencond) // 使用时间戳(毫秒)构建时间
import java.text.SimpleDateFormat
val date1 = Date(); // 或者 val date1 = Date(1768208778735L)
val f1 = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
val s2 = f1.format(date1) // 2020-06-30 11:00:26.401
来源:https://chuna2.787528.xyz/jasongrass/p/13214395.html
浙公网安备 33010602011771号