mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
10 lines
334 B
Kotlin
10 lines
334 B
Kotlin
package com.github.libretube.extensions
|
|
|
|
import kotlinx.datetime.LocalDate
|
|
import kotlinx.datetime.TimeZone
|
|
import kotlinx.datetime.atStartOfDayIn
|
|
import kotlinx.datetime.toLocalDate
|
|
|
|
fun LocalDate.toMillis() = this.atStartOfDayIn(TimeZone.UTC).toEpochMilliseconds()
|
|
|
|
fun String.toLocalDateSafe() = this.substring(0, 10).toLocalDate() |