mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-01 08:45:16 +08:00
Added Long.toUtcTime function in FunctionFactory
This commit is contained in:
@@ -52,6 +52,8 @@ import com.topjohnwu.superuser.Shell
|
||||
import java.io.Serializable
|
||||
import java.math.RoundingMode
|
||||
import java.text.DecimalFormat
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* 系统深色模式是否开启
|
||||
@@ -210,6 +212,12 @@ fun Number.decimal(count: Int = 2) = runCatching {
|
||||
).apply { roundingMode = RoundingMode.HALF_UP }.format(this) ?: toString()
|
||||
}.getOrNull() ?: this
|
||||
|
||||
/**
|
||||
* [Long] 转换为 UTC 时间
|
||||
* @return [String]
|
||||
*/
|
||||
fun Long.toUtcTime() = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.ROOT).format(Date(this)) ?: ""
|
||||
|
||||
/**
|
||||
* 弹出 [Toast]
|
||||
* @param msg 提示内容
|
||||
|
Reference in New Issue
Block a user