pull/37/head
kunfei 5 years ago
parent 705fb7a00b
commit 433fa3cba4
  1. 15
      app/src/main/java/io/legado/app/utils/TimeUtils.kt

@ -1,10 +1,23 @@
package io.legado.app.utils
import android.annotation.SuppressLint
import java.text.SimpleDateFormat
object TimeUtils {
fun stringTimeToLong(time: String): Long {
private val formatArray = arrayOf("")
@SuppressLint("SimpleDateFormat")
fun stringTimeToLong(time: String): Long {
for (str in formatArray) {
try {
val df = SimpleDateFormat(str)
val d = df.parse(time)
return d.time
} catch (e: Exception) {
}
}
return System.currentTimeMillis()
}

Loading…
Cancel
Save